Changeset 1158 for XIOS/dev/dev_olga/src/client.cpp
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/client.cpp
r1152 r1158 18 18 MPI_Comm CClient::interComm ; 19 19 std::list<MPI_Comm> CClient::contextInterComms; 20 int CClient::serverLeader ;20 int CClient::serverLeader ; 21 21 bool CClient::is_MPI_Initialized ; 22 22 int CClient::rank_ = INVALID_RANK; … … 54 54 } 55 55 CTimer::get("XIOS").resume() ; 56 CTimer::get("XIOS init ").resume() ;56 CTimer::get("XIOS init/finalize").resume() ; 57 57 boost::hash<string> hashString ; 58 58 59 unsigned long hashClient = hashString(codeId) ; 60 unsigned long hashServer = hashString(CXios::xiosCodeId); 61 // unsigned long hashServer = hashString(CXios::xiosCodeIdPrm); 59 unsigned long hashClient=hashString(codeId) ; 60 unsigned long hashServer=hashString(CXios::xiosCodeId) ; 62 61 unsigned long* hashAll ; 63 62 int size ; … … 71 70 hashAll=new unsigned long[size] ; 72 71 73 MPI_Allgather(&hashClient, 1, MPI_LONG, hashAll, 1, MPI_LONG,CXios::globalComm) ;72 MPI_Allgather(&hashClient,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ; 74 73 75 74 map<unsigned long, int> colors ; … … 90 89 for (i=0; i < size; ++i) 91 90 { 92 if (hash All[i] == hashString(CXios::xiosCodeId))91 if (hashServer == hashAll[i]) 93 92 { 94 93 CXios::setUsingServer(); … … 148 147 149 148 CTimer::get("XIOS").resume() ; 150 CTimer::get("XIOS init ").resume() ;149 CTimer::get("XIOS init/finalize").resume() ; 151 150 152 151 if (CXios::usingServer) … … 216 215 217 216 int messageSize=msg.size() ; 218 void* buff = new char[messageSize] ;219 CBufferOut buffer( buff,messageSize) ;217 char * buff = new char[messageSize] ; 218 CBufferOut buffer((void*)buff,messageSize) ; 220 219 buffer<<msg ; 221 220 222 MPI_Send(buff, buffer.count(), MPI_CHAR, serverLeader, 1, CXios::globalComm) ; 223 MPI_Intercomm_create(contextComm, 0, CXios::globalComm, serverLeader, 10+globalRank, &contextInterComm) ; 221 MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 222 223 MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 224 224 info(10)<<"Register new Context : "<<id<<endl ; 225 225 MPI_Comm inter ; … … 257 257 MPI_Comm_free(&intraComm); 258 258 259 CTimer::get("XIOS finalize").suspend() ;259 CTimer::get("XIOS init/finalize").suspend() ; 260 260 CTimer::get("XIOS").suspend() ; 261 261 … … 267 267 268 268 info(20) << "Client side context is finalized"<<endl ; 269 report(0) <<" Performance report : Whole time from XIOS init and finalize: "<< CTimer::get("XIOS init/finalize").getCumulatedTime()<<" s"<<endl ; 269 270 report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 270 271 report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; 271 report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS ").getCumulatedTime()*100.<<" %"<<endl ;272 report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS init/finalize").getCumulatedTime()*100.<<" %"<<endl ; 272 273 report(0)<< " Performance report : This ratio must be close to zero. Otherwise it may be usefull to increase buffer size or numbers of server"<<endl ; 273 274 // report(0)<< " Memory report : Current buffer_size : "<<CXios::bufferSize<<endl ; 274 275 report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 275 276 report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 276 277 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 277 278 } 278 279
Note: See TracChangeset
for help on using the changeset viewer.