source: XIOS3/branches/xios-3.0-beta/src/interface/c/icmem_checker.cpp @ 2427

Last change on this file since 2427 was 2427, checked in by jderouillat, 17 months ago

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

File size: 495 bytes
Line 
1
2#include "mem_checker.hpp"
3#include <string>
4#include <iostream>
5
6
7using namespace xios;
8
9extern "C"
10{
11  void cxios_mem_checker_get(double* mem)
12  {
13    std::vector<double> memories = CMemChecker::getMem();
14    if (memories.size()>1)
15    {
16      *mem=memories[1]; //rss
17    }
18    else
19    {
20      *mem = 0.;
21    }
22  }
23
24  void cxios_mem_checker_log(const char* mem_id, int len_mem_id, bool* finalize)
25  {
26    std::string str(mem_id,len_mem_id);
27    CMemChecker::logMem(str, *finalize);
28  }
29
30}
31
32
Note: See TracBrowser for help on using the repository browser.