Changeset 1227 for XIOS/dev


Ignore:
Timestamp:
07/26/17 10:34:17 (7 years ago)
Author:
oabramkina
Message:

Minor modifications:

  • changing sizes of client buffers from int to size_t
  • adding attribute maxBufferSize.
Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/buffer_client.cpp

    r1201 r1227  
    3737  } 
    3838 
    39   int CClientBuffer::remain(void) 
     39  StdSize CClientBuffer::remain(void) 
    4040  { 
    4141    return bufferSize - count; 
    4242  } 
    4343 
    44   bool CClientBuffer::isBufferFree(int size) 
     44  bool CClientBuffer::isBufferFree(StdSize size) 
    4545  { 
    4646    if (size > bufferSize) 
    47       ERROR("bool CClientBuffer::isBufferFree(int size)", 
     47      ERROR("bool CClientBuffer::isBufferFree(StdSize size)", 
    4848            << "The requested size (" << size << " bytes) is too big to fit the buffer (" << bufferSize << " bytes), please increase the client buffer size." << endl); 
    4949 
     
    6464 
    6565 
    66   CBufferOut* CClientBuffer::getBuffer(int size) 
     66  CBufferOut* CClientBuffer::getBuffer(StdSize size) 
    6767  { 
    6868    if (size <= remain()) 
     
    7575    else 
    7676    { 
    77       ERROR("CBufferOut* CClientBuffer::getBuffer(int size)", 
     77      ERROR("CBufferOut* CClientBuffer::getBuffer(StdSize size)", 
    7878            << "Not enough space in buffer, this should not have happened..."); 
    7979      return NULL; 
  • XIOS/dev/XIOS_DEV_CMIP6/src/buffer_client.hpp

    r1201 r1227  
    1717      ~CClientBuffer(); 
    1818 
    19       bool isBufferFree(int size); 
    20       CBufferOut* getBuffer(int size); 
     19      bool isBufferFree(StdSize size); 
     20      CBufferOut* getBuffer(StdSize size); 
    2121      bool checkBuffer(void); 
    2222      bool hasPendingRequest(void); 
    23       int remain(void); 
     23      StdSize remain(void); 
    2424 
    2525    private: 
     
    2727 
    2828      int current; 
    29       int count; 
    30       int bufferedEvents; 
    31       int maxEventSize; 
    32       const int maxBufferedEvents; 
    33       const int bufferSize; 
    34       const int estimatedMaxEventSize; 
     29 
     30      StdSize count; 
     31      StdSize bufferedEvents; 
     32      StdSize maxEventSize; 
     33      const StdSize maxBufferedEvents; 
     34      const StdSize bufferSize; 
     35      const StdSize estimatedMaxEventSize; 
     36 
     37 
    3538      const int serverRank; 
    3639      bool pending; 
  • XIOS/dev/XIOS_DEV_CMIP6/src/cxios.cpp

    r1168 r1227  
    3131  const double CXios::defaultBufferSizeFactor = 1.0; 
    3232  StdSize CXios::minBufferSize = 1024 * sizeof(double); 
     33  StdSize CXios::maxBufferSize = std::numeric_limits<int>::max() ; 
    3334  bool CXios::printLogs2Files; 
    3435  bool CXios::isOptPerformance = true; 
     
    7071    bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor); 
    7172    minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double)); 
     73    maxBufferSize = getin<int>("max_buffer_size", std::numeric_limits<int>::max()); 
    7274    recvFieldTimeout = getin<double>("recv_field_timeout", 10.0); 
    7375    if (recvFieldTimeout < 0.0) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/cxios.hpp

    r1158 r1227  
    4747     static const double defaultBufferSizeFactor; //!< Default factor value 
    4848     static StdSize minBufferSize; //!< Minimum buffer size 
     49     static StdSize maxBufferSize; //!< Maximum buffer size 
    4950     static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) 
    5051     static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/context.cpp

    r1215 r1227  
    313313       if (it->second > bufferSize[it->first]) bufferSize[it->first] = it->second; 
    314314 
    315      // Apply the buffer size factor and check that we are above the minimum buffer size 
     315     // Apply the buffer size factor, check that we are above the minimum buffer size and below the maximum size 
    316316     ite = bufferSize.end(); 
    317317     for (it = bufferSize.begin(); it != ite; ++it) 
     
    319319       it->second *= CXios::bufferSizeFactor; 
    320320       if (it->second < minBufferSize) it->second = minBufferSize; 
     321       if (it->second > CXios::maxBufferSize) it->second = CXios::maxBufferSize; 
    321322     } 
    322323 
Note: See TracChangeset for help on using the changeset viewer.