Ignore:
Timestamp:
11/22/22 14:25:20 (17 months ago)
Author:
jderouillat
Message:

Backport the XIOS3 system to log the memory consumption (commit ID [2418-2420,2425-2426])

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS2/trunk/src/io/netCdfInterface_impl.hpp

    r1158 r2428  
    1313#include "netCdfInterface.hpp" 
    1414#include "netCdfException.hpp" 
     15#include "mem_checker.hpp" 
    1516 
    1617namespace xios 
     
    2829  int CNetCdfInterface::getAttType(int ncid, int varId, const StdString& attrName, T* data) 
    2930  { 
     31    CMemChecker::get("NetCDF get/put").resume(); 
    3032    int status = ncGetAttType(ncid, varId, attrName.c_str(), data); 
    3133    if (NC_NOERR != status) 
     
    3941      throw CNetCdfException(sstr.str()); 
    4042    } 
     43    CMemChecker::get("NetCDF get/put").suspend(); 
    4144 
    4245    return status; 
     
    5760                                   StdSize numVal, const T* data) 
    5861  { 
     62    CMemChecker::get("NetCDF get/put").resume(); 
    5963    int status = ncPutAttType(ncid, varId, attrName.c_str(), numVal, data); 
    6064    if (NC_NOERR != status) 
     
    6973      throw CNetCdfException(sstr.str()); 
    7074    } 
     75    CMemChecker::get("NetCDF get/put").suspend(); 
    7176 
    7277    return status; 
     
    8590  int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, T* data) 
    8691  { 
     92    CMemChecker::get("NetCDF get/put").resume(); 
    8793    int status = ncGetVaraType(ncid, varId, start, count, data); 
    8894    if (NC_NOERR != status) 
     
    96102      throw CNetCdfException(sstr.str()); 
    97103    } 
     104    CMemChecker::get("NetCDF get/put").suspend(); 
    98105 
    99106    return status; 
     
    112119  int CNetCdfInterface::putVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, const T* data) 
    113120  { 
     121    CMemChecker::get("NetCDF get/put").resume(); 
    114122    int status = ncPutVaraType(ncid, varId, start, count, data); 
    115123    if (NC_NOERR != status) 
     
    123131      throw CNetCdfException(sstr.str()); 
    124132    } 
    125  
     133    CMemChecker::get("NetCDF get/put").suspend(); 
     134     
    126135    return status; 
    127136  } 
Note: See TracChangeset for help on using the changeset viewer.