Proto  3.2
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Proto::memInfo< MEMTYPE > Class Template Reference

#include <Proto_MemInfo.H>

Public Member Functions

 memInfo ()
 constructor More...
 
void enterInfo (std::string file, unsigned int line, unsigned long int dataSize)
 insert function More...
 
void enterInfos (std::pair< std::string, unsigned int > a_position, describeInfo &a_elem)
 insert function More...
 
void addTracePoint ()
 insert function More...
 
void addTracePointHost ()
 insert function More...
 
bool fexists (std::string filename)
 check function More...
 
void printInfo ()
 

Static Public Member Functions

static memInfo< MEMTYPE > & getMemInfo ()
 

Private Attributes

std::map< std::pair< std::string, unsigned int >, describeInfom_info
 accumulate data size allocations for each malloc position in the code More...
 
traceInfo m_trace
 store the current and maximum memory footprint for each malloc More...
 

Constructor & Destructor Documentation

◆ memInfo()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
Proto::memInfo< MEMTYPE >::memInfo ( )
inline

constructor

default constructor

Member Function Documentation

◆ enterInfo()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
void Proto::memInfo< MEMTYPE >::enterInfo ( std::string  file,
unsigned int  line,
unsigned long int  dataSize 
)
inline

insert function

Enter information in a 'describeInfo' element element are defined by their location: file + line if the position does not exist, we create it

Parameters
fileis file position for a given Malloc
lineis line position in the file for a given Malloc
dataSizeis size for a given Malloc

References Proto::describeInfo::count, and Proto::describeInfo::dataSize.

◆ enterInfos()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
void Proto::memInfo< MEMTYPE >::enterInfos ( std::pair< std::string, unsigned int >  a_position,
describeInfo a_elem 
)
inline

insert function

Enter information in a 'describeInfo' element element are defined by their position: file + line if the position does not already exist, we create it

Parameters
positionis the position in the code for a given Malloc
a_elemcontains the related information for a position in an other mpi process (used with mpi)

◆ addTracePoint()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
void Proto::memInfo< MEMTYPE >::addTracePoint ( )
inline

insert function

add a memory trace point for the device memory

◆ addTracePointHost()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
void Proto::memInfo< MEMTYPE >::addTracePointHost ( )
inline

insert function

add a memory trace point for the host memory

◆ fexists()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
bool Proto::memInfo< MEMTYPE >::fexists ( std::string  filename)
inline

check function

check if a file exist. We avoid to rewrite a file when we print de memory trace.

◆ printInfo()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
void Proto::memInfo< MEMTYPE >::printInfo ( )
inline

display information stored in m_info and write the memory trace

References Proto::describeInfo::count, Proto::describeInfo::dataSize, Proto::line, Proto::numProc(), and Proto::procID().

◆ getMemInfo()

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
static memInfo<MEMTYPE>& Proto::memInfo< MEMTYPE >::getMemInfo ( )
inlinestatic

trick to get only one instance of memInfo for a given MEMTYPE

References Proto::numProc(), and Proto::procID().

Member Data Documentation

◆ m_info

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
std::map<std::pair<std::string,unsigned int>, describeInfo> Proto::memInfo< MEMTYPE >::m_info
private

accumulate data size allocations for each malloc position in the code

◆ m_trace

template<MemType MEMTYPE = MEMTYPE_DEFAULT>
traceInfo Proto::memInfo< MEMTYPE >::m_trace
private

store the current and maximum memory footprint for each malloc


The documentation for this class was generated from the following file: