Ignore:
Timestamp:
10/09/14 12:28:27 (7 years ago)
Author:
mhnguyen
Message:

Improving format of info and error file

+) Change name of info and error file into xios_client(server)_rank
+) Make format prettier

Test
+) On local: Fedora 20, gcc 4.8
+) Work as expected

File:
1 edited

Legend:

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

    r497 r499  
    3434#else 
    3535     { 
     36      int numDigit = 0; 
     37      int size = 0; 
     38      MPI_Comm_size(CXios::globalComm, &size); 
     39      while (size) 
     40      { 
     41        size /= 10; 
     42        ++numDigit; 
     43      } 
     44 
    3645      StdOFStream fileStream; 
    3746      StdStringStream fileNameErr; 
    3847      std::streambuf* psbuf; 
    39       if (CXios::isClient) fileNameErr<< CXios::errorFile <<"_client_" << CClient::getRank() << ".err"; 
    40       else fileNameErr<< CXios::errorFile <<"_server_" << CServer::getRank() << ".err"; 
     48      if (CXios::isServerSide) 
     49        fileNameErr << CXios::serverFile << "_" << std::setfill('0') 
     50                    << std::setw(numDigit) << CServer::getRank() << ".err"; 
     51      else 
     52        fileNameErr << CXios::clientFile << "_" << std::setfill('0') 
     53                    << std::setw(numDigit) << CClient::getRank() << ".err"; 
     54 
    4155 
    4256      fileStream.open(fileNameErr.str().c_str(), std::ofstream::out); 
Note: See TracChangeset for help on using the changeset viewer.