Ignore:
Timestamp:
07/07/17 18:17:49 (7 years ago)
Author:
oabramkina
Message:

Two server levels: merging trunk r1200 (except for non-contiguous zoom) into dev. Tested on Curie. Todo: non-contiguous zoom.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/context.cpp

    r1194 r1201  
    291291   void CContext::setClientServerBuffer(CContextClient* contextClient) 
    292292   { 
    293      size_t minBufferSize = CXios::minBufferSize; 
     293      // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) 
     294      const size_t minEventSize = CEventClient::headerSize + getIdServer().size() + 10 * sizeof(int); 
     295 
     296      // Ensure there is at least some room for 20 of such events in the buffers 
     297      size_t minBufferSize = std::max(CXios::minBufferSize, 20 * minEventSize); 
     298 
    294299#define DECLARE_NODE(Name_, name_)    \ 
    295300     if (minBufferSize < sizeof(C##Name_##Definition)) minBufferSize = sizeof(C##Name_##Definition); 
     
    299304#undef DECLARE_NODE_PAR 
    300305 
     306     // Compute the buffer sizes needed to send the attributes and data corresponding to fields 
    301307     std::map<int, StdSize> maxEventSize; 
    302308     std::map<int, StdSize> bufferSize = getAttributesBufferSize(maxEventSize, contextClient); 
     
    307313       if (it->second > bufferSize[it->first]) bufferSize[it->first] = it->second; 
    308314 
     315     // Apply the buffer size factor and check that we are above the minimum buffer size 
    309316     ite = bufferSize.end(); 
    310317     for (it = bufferSize.begin(); it != ite; ++it) 
     
    314321     } 
    315322 
    316      // We consider that the minimum buffer size is also the minimum event size 
    317      ite = maxEventSize.end(); 
    318      for (it = maxEventSize.begin(); it != ite; ++it) 
    319        if (it->second < minBufferSize) it->second = minBufferSize; 
    320  
     323     // Leaders will have to send some control events so ensure there is some room for those in the buffers 
    321324     if (contextClient->isServerLeader()) 
    322325     { 
    323326       const std::list<int>& ranks = contextClient->getRanksServerLeader(); 
    324327       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    325          if (!bufferSize.count(*itRank)) bufferSize[*itRank] = maxEventSize[*itRank] = minBufferSize; 
     328       { 
     329         if (!bufferSize.count(*itRank)) 
     330         { 
     331           bufferSize[*itRank] = minBufferSize; 
     332           maxEventSize[*itRank] = minEventSize; 
     333         } 
     334       } 
    326335     } 
    327336     contextClient->setBufferSize(bufferSize, maxEventSize); 
Note: See TracChangeset for help on using the changeset viewer.