Changeset 1130 for XIOS/dev/dev_olga/src/context_client.cpp
- Timestamp:
- 05/15/17 15:00:24 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/context_client.cpp
r1077 r1130 11 11 #include "timer.hpp" 12 12 #include "cxios.hpp" 13 #include "server.hpp" 13 14 14 15 namespace xios … … 89 90 list<int> sizes = event.getSizes(); 90 91 91 // We force the getBuffers call to be non-blocking on theservers92 // We force the getBuffers call to be non-blocking on classical servers 92 93 list<CBufferOut*> buffList; 93 // bool couldBuffer = getBuffers(ranks, sizes, buffList, CXios::isServer);94 bool couldBuffer = getBuffers(ranks, sizes, buffList, false);94 bool couldBuffer = getBuffers(ranks, sizes, buffList, (!CXios::isClient && (CServer::serverLevel == 0) )); 95 //bool couldBuffer = getBuffers(ranks, sizes, buffList, false ); 95 96 96 97 if (couldBuffer) … … 212 213 { 213 214 checkBuffers(); 214 215 // WHY DO WE PUT HERE SERVER INTO LISTENING LOOP AT ALL???? 216 // context->server->listen(); 217 // for (int i = 0; i < context->serverPrimServer.size(); ++i) 218 // context->serverPrimServer[i]->listen(); 215 if (CServer::serverLevel == 0) 216 context->server->listen(); 217 218 else if (CServer::serverLevel == 1) 219 { 220 context->server->listen(); 221 for (int i = 0; i < context->serverPrimServer.size(); ++i) 222 context->serverPrimServer[i]->listen(); 223 } 224 225 else if (CServer::serverLevel == 2) 226 context->server->listen(); 227 219 228 } 220 229 } while (!areBuffersFree && !nonBlocking); 230 221 231 CTimer::get("Blocking time").suspend(); 222 232 … … 256 266 map<int,CClientBuffer*>::iterator itBuff; 257 267 bool pending = false; 258 for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) pending |= itBuff->second->checkBuffer(); 268 for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) 269 pending |= itBuff->second->checkBuffer(); 259 270 return pending; 260 271 } … … 274 285 \return state of buffers, pending(true), ready(false) 275 286 */ 276 // bool CContextClient::checkBuffers(list<int>& ranks)277 287 bool CContextClient::checkBuffers(list<int>& ranks) 278 288 { … … 358 368 359 369 /*! 360 Finalize context client and do some reports 361 */ 362 // void CContextClient::finalize(void) 363 void CContextClient::finalize() 370 * Finalize context client and do some reports. Function is non-blocking. 371 */ 372 void CContextClient::finalize(void) 364 373 { 365 374 map<int,CClientBuffer*>::iterator itBuff; … … 386 395 387 396 CTimer::get("Blocking time").resume(); 388 while (!stop)397 // while (!stop) 389 398 { 390 399 checkBuffers(); … … 393 402 394 403 stop = true; 395 for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop &= !itBuff->second->hasPendingRequest();404 // for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop &= !itBuff->second->hasPendingRequest(); 396 405 } 397 406 CTimer::get("Blocking time").suspend(); … … 409 418 report(0) << " Memory report : Context <" << context->getId() << "> : client side : total memory used for buffer " << totalBuf << " bytes" << endl; 410 419 411 releaseBuffers();420 //releaseBuffers(); // moved to CContext::finalize() 412 421 } 422 423 /*! 424 */ 425 bool CContextClient::havePendingRequests(void) 426 { 427 bool pending = false; 428 map<int,CClientBuffer*>::iterator itBuff; 429 for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) 430 pending |= itBuff->second->hasPendingRequest(); 431 return pending; 432 } 433 434 413 435 }
Note: See TracChangeset
for help on using the changeset viewer.