Changeset 400


Ignore:
Timestamp:
12/13/12 17:07:45 (9 years ago)
Author:
ymipsl
Message:

implement some memory information

  • buffer memory size managment
  • out of memory managment

YM

Location:
XIOS/trunk/src
Files:
2 added
4 edited

Legend:

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

    r382 r400  
    1111{ 
    1212  
     13  size_t maxRequestSize=0 ; 
     14   
    1315  CClientBuffer::CClientBuffer(MPI_Comm interComm_,int serverRank_) 
    1416  { 
     
    4042  bool CClientBuffer::isBufferFree(int size) 
    4143  { 
     44    if (size>maxRequestSize) maxRequestSize=size ; 
     45     
    4246    if (size>bufferSize) ERROR("CClientBuffer::hasSpace(int size)", 
    43                                <<"request size is too big for buffer, increase buffer client size"); 
     47                               <<"request size is too big for buffer, increase buffer client size"<<endl 
     48                               <<"Current buffer_size : "<<CXios::bufferSize<<endl 
     49                               <<"buffer_size must be > "<<size*2<<endl) 
    4450  
    4551    if (size<=remain()) return true ; 
  • XIOS/trunk/src/buffer_client.hpp

    r382 r400  
    88namespace xios 
    99{ 
     10  extern size_t maxRequestSize ; 
     11   
    1012  class CClientBuffer 
    1113  { 
  • XIOS/trunk/src/client.cpp

    r382 r400  
    99#include "mpi.hpp" 
    1010#include "timer.hpp" 
     11#include "buffer_client.hpp" 
    1112 
    1213namespace xios 
     
    204205      report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS").getCumulatedTime()*100.<<" %"<<endl ; 
    205206      report(0)<< " Performance report : This ratio must be close to zero. Otherwise it may be usefull to increase buffer size or numbers of server"<<endl ; 
    206     } 
     207      report(0)<< " Memory report : Current buffer_size : "<<CXios::bufferSize<<endl ; 
     208      report(0)<< " Memory report : Minimum buffer size required : "<<maxRequestSize*2<<endl ; 
     209      report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 
     210   } 
    207211} 
  • XIOS/trunk/src/cxios.cpp

    r382 r400  
    77#include <boost/functional/hash.hpp> 
    88#include "mpi.hpp" 
     9#include "memory.hpp" 
     10#include <new> 
    911 
    1012namespace xios 
     
    2527  void CXios::initialize() 
    2628  { 
     29    set_new_handler(noMemory); 
    2730    parseFile(rootFile); 
    2831    usingServer=getin<bool>("using_server",false) ; 
Note: See TracChangeset for help on using the changeset viewer.