Ignore:
Timestamp:
01/23/15 16:18:43 (9 years ago)
Author:
rlacroix
Message:

Backport r523 into the stable branch.

Improve the message error handling by mimicking the behavior of the info/report logs.

Output the error messages to the standart error message until the context is correctly initialized. Then, output the error messages to a file if the user has set "print_file" parameter to "true".

  • Fix: Errors that occured before MPI was initialized (e.g. during the config file parsing) caused a MPI error on top of the original error.
  • Fix: The error file could sometimes be misnamed if the error happened before the context was completely known.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/branchs/xios-1.0/src/cxios.cpp

    r507 r548  
    2727  size_t CXios::defaultBufferSize=1024*1024*100 ; // 100Mo 
    2828  double CXios::defaultBufferServerFactorSize=2 ; 
    29   bool CXios::printInfo2File; 
    30   bool CXios::isServerSide; 
     29  bool CXios::printLogs2Files; 
    3130 
    3231 
     
    3837    usingServer=getin<bool>("using_server",false) ; 
    3938    info.setLevel(getin<int>("info_level",0)) ; 
    40     printInfo2File=getin<bool>("print_file",false); 
     39    printLogs2Files=getin<bool>("print_file",false); 
    4140    bufferSize=getin<size_t>("buffer_size",defaultBufferSize) ; 
    4241    bufferServerFactorSize=getin<double>("buffer_server_factor_size",defaultBufferServerFactorSize) ; 
     
    5453    CClient::initialize(codeId,localComm,returnComm) ; 
    5554 
    56     if (usingServer) isServerSide = isServer=false; 
    57     else isServerSide = isServer=true; 
     55    if (usingServer) isServer=false; 
     56    else isServer=true; 
    5857 
    59     if (printInfo2File) 
     58    if (printLogs2Files) 
     59    { 
    6060      CClient::openInfoStream(clientFile); 
     61      CClient::openErrorStream(clientFile); 
     62    } 
    6163    else 
     64    { 
    6265      CClient::openInfoStream(); 
     66      CClient::openErrorStream(); 
     67    } 
    6368  } 
    6469 
     
    8287    isServer=false ; 
    8388 
    84     isServerSide = true; 
    85  
    8689    // Initialize all aspects MPI 
    8790    CServer::initialize(); 
    8891 
    89     if (printInfo2File) 
     92    if (printLogs2Files) 
     93    { 
    9094      CServer::openInfoStream(serverFile); 
     95      CServer::openErrorStream(serverFile); 
     96    } 
    9197    else 
     98    { 
    9299      CServer::openInfoStream(); 
     100      CServer::openErrorStream(); 
     101    } 
    93102 
    94103    // Enter the loop to listen message from Client 
Note: See TracChangeset for help on using the changeset viewer.