Ignore:
Timestamp:
09/26/14 14:52:04 (10 years ago)
Author:
mhnguyen
Message:

Implementing print output in seperate files

+) Add an option to write information into standard output or into files,
each of which is created by a process
+) Add a new file for global data (constant, value macro, etc)
+) Do a minor change in how to generate doxygen

Test
+) On Curie, with two modes: only client (connected) and client-server
+) All tests passed, each client prints out its info in a seperate file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/cxios.cpp

    r401 r490  
    1515  string CXios::rootFile="./iodef.xml" ; 
    1616  string CXios::xiosCodeId="xios.x" ; 
    17    
     17  string CXios::infoFile="./info_output"; 
     18 
    1819  bool CXios::isClient ; 
    1920  bool CXios::isServer ; 
    2021  MPI_Comm CXios::globalComm ; 
    2122  bool CXios::usingOasis ; 
    22   bool CXios::usingServer ;    
     23  bool CXios::usingServer ; 
    2324  size_t CXios::bufferSize ; 
    2425  double CXios::bufferServerFactorSize=2 ; 
    2526  size_t CXios::defaultBufferSize=1024*1024*100 ; // 100Mo 
    2627  double CXios::defaultBufferServerFactorSize=2 ; 
    27    
     28  bool CXios::printInfo2File; 
     29 
     30 
    2831  void CXios::initialize() 
    2932  { 
     
    3336    usingOasis=getin<bool>("using_oasis",false) ; 
    3437    info.setLevel(getin<int>("info_level",0)) ; 
     38    printInfo2File=getin<bool>("info_output_file",false); 
    3539    bufferSize=getin<size_t>("buffer_size",defaultBufferSize) ; 
    3640    bufferServerFactorSize=getin<double>("buffer_server_factor_size",defaultBufferServerFactorSize) ; 
     
    4145  void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 
    4246  { 
    43       
     47 
    4448    initialize() ; 
    45      
     49 
    4650    isClient=true; 
    4751    if (usingServer) isServer=false; 
    4852    else isServer=true ; 
    49      
     53 
    5054    CClient::initialize(codeId,localComm,returnComm) ; 
    5155 
    52   }    
     56    if (printInfo2File) 
     57      CClient::openInfoStream(infoFile); 
     58    else 
     59      CClient::openInfoStream(); 
     60  } 
    5361 
    5462  void CXios::clientFinalize(void) 
    5563  { 
    56      CClient::finalize() ;  
     64     CClient::finalize() ; 
     65     CClient::closeInfoStream(); 
     66 
    5767#ifdef XIOS_MEMTRACK 
    5868     MemTrack::TrackListMemoryUsage() ; 
    59      MemTrack::TrackDumpBlocks();   
     69     MemTrack::TrackDumpBlocks(); 
    6070#endif 
    61   }    
    62    
    63    
     71  } 
     72 
     73 
    6474  void CXios::initServerSide(void) 
    6575  { 
     
    7080    isServer=false ; 
    7181 
    72     CServer::initialize() ; 
    73   }  
    74    
     82    //! Initialize all aspect MPI 
     83    CServer::initialize(); 
     84 
     85    if (printInfo2File) 
     86      CServer::openInfoStream(infoFile); 
     87    else 
     88      CServer::openInfoStream(); 
     89 
     90    //! Enter the loop to listen message from Client 
     91    CServer::eventLoop(); 
     92 
     93    //! Finalize 
     94    CServer::finalize(); 
     95    CServer::closeInfoStream(); 
     96  } 
     97 
    7598  void CXios::parseFile(const string& filename) 
    7699  { 
    77     xml::CXMLParser::ParseFile(filename);  
     100    xml::CXMLParser::ParseFile(filename); 
    78101  } 
    79    
    80  
    81102} 
Note: See TracChangeset for help on using the changeset viewer.