- Timestamp:
- 10/09/14 12:28:25 (10 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client.cpp
r493 r497 249 249 std::filebuf* fb = m_infoStream.rdbuf(); 250 250 StdStringStream fileNameClient; 251 fileNameClient << fileName <<"_client_" << getRank() << ".out"; 251 int numDigit = 0; 252 int size = 0; 253 MPI_Comm_size(CXios::globalComm, &size); 254 while (size) 255 { 256 size /= 10; 257 ++numDigit; 258 } 259 260 fileNameClient << fileName <<"_client_" << std::setfill('0') << std::setw(numDigit) << getRank() << ".out"; 252 261 fb->open(fileNameClient.str().c_str(), std::ios::out); 253 262 if (!fb->is_open()) -
XIOS/trunk/src/cxios.cpp
r491 r497 16 16 string CXios::xiosCodeId="xios.x" ; 17 17 string CXios::infoFile="./info_output"; 18 string CXios::errorFile="./error_output"; 18 19 19 20 bool CXios::isClient ; … … 75 76 { 76 77 initialize(); 77 78 // if (!usingServer) ERROR("void CXios::initServerSide(void)",<<"using_server is set to <false> and server initialization is called") ;79 78 isClient=true; 80 79 isServer=false ; -
XIOS/trunk/src/cxios.hpp
r491 r497 14 14 static string xiosCodeId ; 15 15 static string infoFile; 16 static string errorFile; 16 17 17 18 static void initialize(void) ; -
XIOS/trunk/src/exception.cpp
r335 r497 3 3 /// boost headers /// 4 4 #include <boost/cast.hpp> 5 #include "client.hpp" 6 #include "server.hpp" 7 #include "cxios.hpp" 5 8 6 9 namespace xios … … 23 26 24 27 CException::~CException(void) 25 { 28 { 26 29 if (desc_rethrow) 27 30 #ifdef __XIOS_NOABORT 28 throw (*this); 31 { 32 throw (*this); 33 } 29 34 #else 35 { 36 StdOFStream fileStream; 37 StdStringStream fileNameErr; 38 std::streambuf* psbuf; 39 if (CXios::isClient) fileNameErr<< CXios::errorFile <<"_client_" << CClient::getRank() << ".err"; 40 else fileNameErr<< CXios::errorFile <<"_server_" << CServer::getRank() << ".err"; 41 42 fileStream.open(fileNameErr.str().c_str(), std::ofstream::out); 43 psbuf = fileStream.rdbuf(); 44 std::cerr.rdbuf(psbuf); 30 45 std::cerr << this->getMessage() << std::endl; 46 fileStream.close(); 31 47 abort(); 48 } 49 32 50 #endif 33 51 } -
XIOS/trunk/src/log.hpp
r490 r497 18 18 if (l<=level) 19 19 { 20 // rdbuf(cout.rdbuf()) ;21 20 rdbuf(strBuf_); 22 21 *this<<"-> "<<name<<" : " ; -
XIOS/trunk/src/server.cpp
r493 r497 416 416 std::filebuf* fb = m_infoStream.rdbuf(); 417 417 StdStringStream fileNameServer; 418 fileNameServer << fileName <<"_server_"<<getRank() << ".out"; 418 int numDigit = 0; 419 int size = 0; 420 MPI_Comm_size(CXios::globalComm, &size); 421 while (size) 422 { 423 size /= 10; 424 ++numDigit; 425 } 426 427 fileNameServer << fileName <<"_server_" << std::setfill('0') << std::setw(numDigit) << getRank() << ".out"; 419 428 fb->open(fileNameServer.str().c_str(), std::ios::out); 420 429 if (!fb->is_open())
Note: See TracChangeset
for help on using the changeset viewer.