Ignore:
Timestamp:
12/01/14 16:21:48 (9 years ago)
Author:
rlacroix
Message:

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/trunk/src/cxios.cpp

    r512 r523  
    2525  double CXios::bufferServerFactorSize=1.0 ; 
    2626  double CXios::defaultBufferServerFactorSize=1.0 ; 
    27   bool CXios::printInfo2File; 
    28   bool CXios::isServerSide; 
     27  bool CXios::printLogs2Files; 
    2928  bool CXios::isOptPerformance = true; 
    3029 
     
    4746    info.setLevel(getin<int>("info_level",0)) ; 
    4847    report.setLevel(getin<int>("info_level",50)); 
    49     printInfo2File=getin<bool>("print_file",false); 
     48    printLogs2Files=getin<bool>("print_file",false); 
    5049 
    5150    StdString bufMemory("memory"); 
     
    7776    CClient::initialize(codeId,localComm,returnComm) ; 
    7877 
    79     if (usingServer) isServerSide = isServer=false; 
    80     else isServerSide = isServer=true; 
     78    if (usingServer) isServer=false; 
     79    else isServer=true; 
    8180 
    82     if (printInfo2File) 
     81    if (printLogs2Files) 
     82    { 
    8383      CClient::openInfoStream(clientFile); 
     84      CClient::openErrorStream(clientFile); 
     85    } 
    8486    else 
     87    { 
    8588      CClient::openInfoStream(); 
     89      CClient::openErrorStream(); 
     90    } 
    8691  } 
    8792 
     
    114119    isServer=false ; 
    115120 
    116     isServerSide = true; 
    117  
    118121    // Initialize all aspects MPI 
    119122    CServer::initialize(); 
    120123 
    121     if (printInfo2File) 
     124    if (printLogs2Files) 
     125    { 
    122126      CServer::openInfoStream(serverFile); 
     127      CServer::openErrorStream(serverFile); 
     128    } 
    123129    else 
     130    { 
    124131      CServer::openInfoStream(); 
     132      CServer::openErrorStream(); 
     133    } 
    125134 
    126135    // Enter the loop to listen message from Client 
Note: See TracChangeset for help on using the changeset viewer.