Ignore:
Timestamp:
07/03/17 14:34:22 (7 years ago)
Author:
rlacroix
Message:

Display a warning message if an event has a size greater than the estimated maximum event size.

This should not happen in theory and must be fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/buffer_client.cpp

    r917 r1192  
    1212  size_t CClientBuffer::maxRequestSize = 0; 
    1313 
    14   CClientBuffer::CClientBuffer(MPI_Comm interComm, int serverRank, StdSize bufferSize, StdSize maxBufferedEvents) 
     14  CClientBuffer::CClientBuffer(MPI_Comm interComm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents) 
    1515    : interComm(interComm) 
    1616    , serverRank(serverRank) 
    1717    , bufferSize(bufferSize) 
     18    , estimatedMaxEventSize(estimatedMaxEventSize) 
     19    , maxEventSize(0) 
    1820    , current(0) 
    1921    , count(0) 
     
    4244  bool CClientBuffer::isBufferFree(int size) 
    4345  { 
    44     if (size > maxRequestSize) maxRequestSize = size; 
    45  
    4646    if (size > bufferSize) 
    4747      ERROR("bool CClientBuffer::isBufferFree(int size)", 
    4848            << "The requested size (" << size << " bytes) is too big to fit the buffer (" << bufferSize << " bytes), please increase the client buffer size." << endl); 
     49 
     50    if (size > maxEventSize) 
     51    { 
     52      maxEventSize = size; 
     53 
     54      if (size > estimatedMaxEventSize) 
     55        error(0) << "WARNING: Unexpected event of size " << size << " for server " << serverRank 
     56                 << " (estimated max event size = " << estimatedMaxEventSize << ")" << std::endl; 
     57 
     58      if (size > maxRequestSize) maxRequestSize = size; 
     59    } 
     60 
    4961 
    5062    return (size <= remain() && bufferedEvents < maxBufferedEvents); 
Note: See TracChangeset for help on using the changeset viewer.