Changeset 1071 for XIOS/dev/dev_olga/src/context_client.cpp
- Timestamp:
- 03/13/17 17:21:04 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/context_client.cpp
r1054 r1071 91 91 // We force the getBuffers call to be non-blocking on the servers 92 92 list<CBufferOut*> buffList; 93 bool couldBuffer = getBuffers(ranks, sizes, buffList, !CXios::isClient);94 93 // bool couldBuffer = getBuffers(ranks, sizes, buffList, CXios::isServer); 94 bool couldBuffer = getBuffers(ranks, sizes, buffList, false); 95 95 96 96 if (couldBuffer) … … 182 182 * \return whether the already allocated buffers could be used 183 183 */ 184 bool CContextClient::getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking /*= false*/) 184 bool CContextClient::getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, 185 bool nonBlocking /*= false*/) 185 186 { 186 187 list<int>::const_iterator itServer, itSize; … … 211 212 { 212 213 checkBuffers(); 213 // if (?) 214 // { 214 215 // WHY DO WE PUT HERE SERVER INTO LISTENING LOOP AT ALL???? 216 // context->server->listen(); 215 217 // for (int i = 0; i < context->serverPrimServer.size(); ++i) 216 218 // context->serverPrimServer[i]->listen(); 217 // }218 // else219 context->server->listen();220 219 } 221 220 } while (!areBuffersFree && !nonBlocking); … … 237 236 void CContextClient::newBuffer(int rank) 238 237 { 239 240 241 242 243 244 245 246 247 248 238 if (!mapBufferSize_.count(rank)) 239 { 240 error(0) << "WARNING: Unexpected request for buffer to communicate with server " << rank << std::endl; 241 mapBufferSize_[rank] = CXios::minBufferSize; 242 } 243 CClientBuffer* buffer = buffers[rank] = new CClientBuffer(interComm, rank, mapBufferSize_[rank], maxBufferedEvents); 244 // Notify the server 245 CBufferOut* bufOut = buffer->getBuffer(sizeof(StdSize)); 246 bufOut->put(mapBufferSize_[rank]); // Stupid C++ 247 buffer->checkBuffer(); 249 248 } 250 249 … … 262 261 263 262 //! Release all buffers 264 void CContextClient::releaseBuffers( void)263 void CContextClient::releaseBuffers() 265 264 { 266 265 map<int,CClientBuffer*>::iterator itBuff; 267 266 for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) delete itBuff->second; 267 // buffersReleased_ = true; 268 268 } 269 269 … … 273 273 \return state of buffers, pending(true), ready(false) 274 274 */ 275 // bool CContextClient::checkBuffers(list<int>& ranks) 275 276 bool CContextClient::checkBuffers(list<int>& ranks) 276 277 { … … 358 359 Finalize context client and do some reports 359 360 */ 360 void CContextClient::finalize(void) 361 // void CContextClient::finalize(void) 362 void CContextClient::finalize() 361 363 { 362 364 map<int,CClientBuffer*>::iterator itBuff; … … 396 398 std::map<int,StdSize>::const_iterator itbMap = mapBufferSize_.begin(), 397 399 iteMap = mapBufferSize_.end(), itMap; 400 398 401 StdSize totalBuf = 0; 399 402 for (itMap = itbMap; itMap != iteMap; ++itMap)
Note: See TracChangeset
for help on using the changeset viewer.