Changeset 491
- Timestamp:
- 09/26/14 14:52:09 (10 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/COMPLETE/iodef.xml
r490 r491 1 1 <?xml version="1.0"?> 2 <simulation> 2 <simulation> 3 3 4 4 <context id="atmosphere" src="./context_atmosphere.xml"/> … … 10 10 <variable_group id="buffer"> 11 11 buffer_size = 80000000 12 buffer_server_factor_size = 2 12 buffer_server_factor_size = 2 13 13 </variable_group> 14 14 15 15 <variable_group id="parameters" > 16 <variable id="using_server" type="boolean">false</variable>17 16 <variable id="info_level" type="int">100</variable> 18 <variable id=" info_output_file" type="boolean">true</variable>17 <variable id="print_file" type="boolean">true</variable> 19 18 </variable_group> 20 19 </variable_definition> -
XIOS/trunk/src/client.cpp
r490 r491 73 73 } 74 74 75 // Verify whether we are on server mode or not 76 CXios::setNotUsingServer(); 77 for (i=0; i < size; ++i) 78 { 79 if (hashServer == hashAll[i]) 80 { 81 CXios::setUsingServer(); 82 break; 83 } 84 } 85 75 86 myColor=colors[hashClient] ; 76 87 … … 116 127 CTimer::get("XIOS init").resume() ; 117 128 129 // Verify whether we are on server mode or not 130 CXios::setNotUsingServer(); 131 int interCommSize = 0, intraCommSize = 0; 132 oasis_get_intercomm(interComm,CXios::xiosCodeId); 133 MPI_Comm_size(interComm, &interCommSize); 134 MPI_Comm_size(intraComm, &intraCommSize); 135 if (interCommSize == intraCommSize) CXios::setUsingServer(); 136 118 137 if (CXios::usingServer) 119 138 { 120 139 MPI_Status status ; 121 140 MPI_Comm_rank(intraComm,&rank) ; 122 141 oasis_get_intercomm(interComm,CXios::xiosCodeId) ; 123 142 if (rank==0) MPI_Recv(&serverLeader,1, MPI_INT, 0, 0, interComm, &status) ; … … 224 243 std::filebuf* fb = m_infoStream.rdbuf(); 225 244 StdStringStream fileNameClient; 226 fileNameClient << fileName <<"_client_" << getRank() << ". txt";245 fileNameClient << fileName <<"_client_" << getRank() << ".out"; 227 246 fb->open(fileNameClient.str().c_str(), std::ios::out); 228 247 if (!fb->is_open()) -
XIOS/trunk/src/cxios.cpp
r490 r491 21 21 MPI_Comm CXios::globalComm ; 22 22 bool CXios::usingOasis ; 23 bool CXios::usingServer ;23 bool CXios::usingServer = false; 24 24 size_t CXios::bufferSize ; 25 25 double CXios::bufferServerFactorSize=2 ; … … 33 33 set_new_handler(noMemory); 34 34 parseFile(rootFile); 35 usingServer=getin<bool>("using_server",false) ;36 35 usingOasis=getin<bool>("using_oasis",false) ; 37 36 info.setLevel(getin<int>("info_level",0)) ; 38 printInfo2File=getin<bool>(" info_output_file",false);37 printInfo2File=getin<bool>("print_file",false); 39 38 bufferSize=getin<size_t>("buffer_size",defaultBufferSize) ; 40 39 bufferServerFactorSize=getin<double>("buffer_server_factor_size",defaultBufferServerFactorSize) ; … … 49 48 50 49 isClient=true; 50 51 CClient::initialize(codeId,localComm,returnComm) ; 52 51 53 if (usingServer) isServer=false; 52 54 else isServer=true ; 53 54 CClient::initialize(codeId,localComm,returnComm) ;55 55 56 56 if (printInfo2File) … … 76 76 initialize(); 77 77 78 if (!usingServer) ERROR("void CXios::initServerSide(void)",<<"using_server is set to <false> and server initialization is called") ;78 // if (!usingServer) ERROR("void CXios::initServerSide(void)",<<"using_server is set to <false> and server initialization is called") ; 79 79 isClient=true; 80 80 isServer=false ; 81 81 82 // ! Initialize all aspectMPI82 // Initialize all aspects MPI 83 83 CServer::initialize(); 84 84 … … 88 88 CServer::openInfoStream(); 89 89 90 // !Enter the loop to listen message from Client90 // Enter the loop to listen message from Client 91 91 CServer::eventLoop(); 92 92 93 // !Finalize93 // Finalize 94 94 CServer::finalize(); 95 95 CServer::closeInfoStream(); … … 100 100 xml::CXMLParser::ParseFile(filename); 101 101 } 102 103 void CXios::setUsingServer() 104 { 105 usingServer = true; 106 } 107 108 void CXios::setNotUsingServer() 109 { 110 usingServer = false; 111 } 102 112 } -
XIOS/trunk/src/cxios.hpp
r490 r491 29 29 static T getin(const string& id) ; 30 30 31 // static void openFileInfo(const StdString& fileName);32 // static void closeFileInfo();33 34 31 static bool isClient ; 35 32 static bool isServer ; … … 45 42 static double defaultBufferServerFactorSize ; 46 43 47 private: 48 // static StdOFStream infoFileStream_; 44 public: 45 //! Setting xios to use server mode 46 static void setUsingServer(); 47 48 //! Setting xios NOT to use server mode 49 static void setNotUsingServer(); 49 50 50 51 } ; -
XIOS/trunk/src/server.cpp
r490 r491 405 405 std::filebuf* fb = m_infoStream.rdbuf(); 406 406 StdStringStream fileNameServer; 407 fileNameServer << fileName <<"_server_"<<getRank() << ". txt";407 fileNameServer << fileName <<"_server_"<<getRank() << ".out"; 408 408 fb->open(fileNameServer.str().c_str(), std::ios::out); 409 409 if (!fb->is_open())
Note: See TracChangeset
for help on using the changeset viewer.