Ignore:
Timestamp:
03/13/17 17:21:04 (7 years ago)
Author:
oabramkina
Message:

dev: test for secondary servers added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/context_client.cpp

    r1054 r1071  
    9191        // We force the getBuffers call to be non-blocking on the servers 
    9292        list<CBufferOut*> buffList; 
    93         bool couldBuffer = getBuffers(ranks, sizes, buffList, !CXios::isClient); 
    9493//        bool couldBuffer = getBuffers(ranks, sizes, buffList, CXios::isServer); 
     94        bool couldBuffer = getBuffers(ranks, sizes, buffList, false); 
    9595 
    9696        if (couldBuffer) 
     
    182182     * \return whether the already allocated buffers could be used 
    183183    */ 
    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*/) 
    185186    { 
    186187      list<int>::const_iterator itServer, itSize; 
     
    211212        { 
    212213          checkBuffers(); 
    213 //          if (?) 
    214 //          { 
     214 
     215         // WHY DO WE PUT HERE SERVER INTO LISTENING LOOP AT ALL???? 
     216//            context->server->listen(); 
    215217//            for (int i = 0; i < context->serverPrimServer.size(); ++i) 
    216218//              context->serverPrimServer[i]->listen(); 
    217 //          } 
    218 //          else 
    219             context->server->listen(); 
    220219        } 
    221220      } while (!areBuffersFree && !nonBlocking); 
     
    237236   void CContextClient::newBuffer(int rank) 
    238237   { 
    239       if (!mapBufferSize_.count(rank)) 
    240       { 
    241         error(0) << "WARNING: Unexpected request for buffer to communicate with server " << rank << std::endl; 
    242         mapBufferSize_[rank] = CXios::minBufferSize; 
    243       } 
    244       CClientBuffer* buffer = buffers[rank] = new CClientBuffer(interComm, rank, mapBufferSize_[rank], maxBufferedEvents); 
    245       // Notify the server 
    246       CBufferOut* bufOut = buffer->getBuffer(sizeof(StdSize)); 
    247       bufOut->put(mapBufferSize_[rank]); // Stupid C++ 
    248       buffer->checkBuffer(); 
     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(); 
    249248   } 
    250249 
     
    262261 
    263262   //! Release all buffers 
    264    void CContextClient::releaseBuffers(void) 
     263   void CContextClient::releaseBuffers() 
    265264   { 
    266265      map<int,CClientBuffer*>::iterator itBuff; 
    267266      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) delete itBuff->second; 
     267//        buffersReleased_ = true; 
    268268   } 
    269269 
     
    273273   \return state of buffers, pending(true), ready(false) 
    274274   */ 
     275//   bool CContextClient::checkBuffers(list<int>& ranks) 
    275276   bool CContextClient::checkBuffers(list<int>& ranks) 
    276277   { 
     
    358359   Finalize context client and do some reports 
    359360   */ 
    360   void CContextClient::finalize(void) 
     361//  void CContextClient::finalize(void) 
     362  void CContextClient::finalize() 
    361363  { 
    362364    map<int,CClientBuffer*>::iterator itBuff; 
     
    396398    std::map<int,StdSize>::const_iterator itbMap = mapBufferSize_.begin(), 
    397399                                          iteMap = mapBufferSize_.end(), itMap; 
     400 
    398401    StdSize totalBuf = 0; 
    399402    for (itMap = itbMap; itMap != iteMap; ++itMap) 
Note: See TracChangeset for help on using the changeset viewer.