Changeset 1192
- Timestamp:
- 07/03/17 14:34:22 (7 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/buffer_client.cpp
r917 r1192 12 12 size_t CClientBuffer::maxRequestSize = 0; 13 13 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) 15 15 : interComm(interComm) 16 16 , serverRank(serverRank) 17 17 , bufferSize(bufferSize) 18 , estimatedMaxEventSize(estimatedMaxEventSize) 19 , maxEventSize(0) 18 20 , current(0) 19 21 , count(0) … … 42 44 bool CClientBuffer::isBufferFree(int size) 43 45 { 44 if (size > maxRequestSize) maxRequestSize = size;45 46 46 if (size > bufferSize) 47 47 ERROR("bool CClientBuffer::isBufferFree(int size)", 48 48 << "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 49 61 50 62 return (size <= remain() && bufferedEvents < maxBufferedEvents); -
XIOS/trunk/src/buffer_client.hpp
r917 r1192 14 14 static size_t maxRequestSize; 15 15 16 CClientBuffer(MPI_Comm intercomm, int serverRank, StdSize bufferSize, StdSize maxBufferedEvents);16 CClientBuffer(MPI_Comm intercomm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents); 17 17 ~CClientBuffer(); 18 18 … … 29 29 int count; 30 30 int bufferedEvents; 31 int maxEventSize; 31 32 const int maxBufferedEvents; 32 33 const int bufferSize; 34 const int estimatedMaxEventSize; 33 35 const int serverRank; 34 36 bool pending; -
XIOS/trunk/src/context_client.cpp
r1033 r1192 234 234 error(0) << "WARNING: Unexpected request for buffer to communicate with server " << rank << std::endl; 235 235 mapBufferSize_[rank] = CXios::minBufferSize; 236 } 237 CClientBuffer* buffer = buffers[rank] = new CClientBuffer(interComm, rank, mapBufferSize_[rank], maxBufferedEvents); 236 maxEventSizes[rank] = CXios::minBufferSize; 237 } 238 CClientBuffer* buffer = buffers[rank] = new CClientBuffer(interComm, rank, mapBufferSize_[rank], maxEventSizes[rank], maxBufferedEvents); 238 239 // Notify the server 239 240 CBufferOut* bufOut = buffer->getBuffer(sizeof(StdSize)); … … 283 284 { 284 285 mapBufferSize_ = mapSize; 286 maxEventSizes = maxEventSize; 285 287 286 288 // Compute the maximum number of events that can be safely buffered. -
XIOS/trunk/src/context_client.hpp
r1033 r1192 76 76 //! Mapping of server and buffer size for each connection to server 77 77 std::map<int,StdSize> mapBufferSize_; 78 //! Maximum event sizes estimated for each connection to server 79 std::map<int,StdSize> maxEventSizes; 78 80 //! Maximum number of events that can be buffered 79 81 StdSize maxBufferedEvents;
Note: See TracChangeset
for help on using the changeset viewer.