Changeset 1130 for XIOS/dev/dev_olga/src/context_server.cpp
- Timestamp:
- 05/15/17 15:00:24 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/context_server.cpp
r1071 r1130 22 22 namespace xios 23 23 { 24 StdSize CContextServer::totalBuf_ = 0;25 24 26 25 CContextServer::CContextServer(CContext* parent, MPI_Comm intraComm_,MPI_Comm interComm_) … … 41 40 finished=false; 42 41 boost::hash<string> hashString; 43 hashId=hashString(context->getId()); 42 if (CServer::serverLevel == 1) 43 hashId=hashString(context->getId() + boost::lexical_cast<string>(context->clientPrimServer.size())); 44 else 45 hashId=hashString(context->getId()); 44 46 } 45 47 … … 169 171 map<size_t,CEventServer*>::iterator it; 170 172 CEventServer* event; 171 boost::hash<string> hashString;172 size_t hashId=hashString(context->getId());173 173 174 174 it=events.find(currentTimeLine); … … 189 189 // The best way to properly solve this problem will be to use the event scheduler also in attached mode 190 190 // for now just set up a MPI barrier 191 // if (!CServer::eventScheduler) MPI_Barrier(intraComm) ;191 if (!CServer::eventScheduler && CXios::isServer) MPI_Barrier(intraComm) ; 192 192 193 193 CTimer::get("Process events").resume(); … … 218 218 int rank; 219 219 list<CEventServer::SSubEvent>::iterator it; 220 // CContext::setCurrent(context->getId());221 220 StdString ctxId = context->getId(); 222 221 CContext::setCurrent(ctxId); 222 StdSize totalBuf = 0; 223 223 224 224 if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE) 225 225 { 226 226 finished=true; 227 // info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl; 227 // info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl; // moved to CContext::finalize() 228 228 std::map<int, StdSize>::const_iterator itbMap = mapBufferSize_.begin(), 229 229 iteMap = mapBufferSize_.end(), itMap; … … 231 231 { 232 232 rank = itMap->first; 233 //report(10)<< " Memory report : Context <"<<ctxId<<"> : server side : memory used for buffer of each connection to client" << endl234 //<< " +) With client of rank " << rank << " : " << itMap->second << " bytes " << endl;235 totalBuf _+= itMap->second;233 report(10)<< " Memory report : Context <"<<ctxId<<"> : server side : memory used for buffer of each connection to client" << endl 234 << " +) With client of rank " << rank << " : " << itMap->second << " bytes " << endl; 235 totalBuf += itMap->second; 236 236 } 237 237 context->finalize(); 238 239 // report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; // moved to CContext::finalize() 238 report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl; 240 239 } 241 240 else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event); … … 261 260 } 262 261 263 size_t CContextServer::getTotalBuf(void)264 {265 return totalBuf_;266 }267 268 262 }
Note: See TracChangeset
for help on using the changeset viewer.