OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MemoryProfiler Class Reference

#include <MemoryProfiler.h>

Inheritance diagram for MemoryProfiler:
Inheritance graph
[legend]
Collaboration diagram for MemoryProfiler:
Collaboration graph
[legend]

Public Types

enum  VirtualMemory {
  VMPEAK = 0 , VMSIZE , VMHWM , VMRSS ,
  VMDATA , VMSTK , VMEXE , VMLCK ,
  VMPIN , VMLIB , VMPTE , VMPMD ,
  VMSWAP
}
 
typedef std::vector< long double > vm_t
 
typedef std::vector< std::string > units_t
 
- Public Types inherited from SDDSWriter
typedef std::pair< std::string, std::string > desc_t
 
typedef std::tuple< std::string, std::string, std::string > param_t
 
typedef std::pair< std::string, size_t > data_t
 
typedef std::tuple< std::string, std::string, std::string, std::string > cols_t
 

Public Member Functions

 MemoryProfiler (const std::string &fname, bool restart)
 
void write (const PartBunchBase< double, 3 > *beam) override
 
- Public Member Functions inherited from SDDSWriter
 SDDSWriter (const std::string &fname, bool restart)
 
virtual ~SDDSWriter ()
 
void rewindLines (size_t numberOfLines)
 delete the last 'numberOfLines' lines of the file 'fileName' More...
 
void replaceVersionString ()
 
double getLastValue (const std::string &column)
 
bool exists () const
 

Private Member Functions

void header ()
 
void update ()
 
void compute (vm_t &vmMin, vm_t &vmMax, vm_t &vmAvg)
 

Private Attributes

std::map< std::string, int > procinfo_m
 
vm_t vmem_m
 
units_t unit_m
 

Additional Inherited Members

- Protected Member Functions inherited from SDDSWriter
void addDescription (const std::string &text, const std::string &content)
 
template<typename T >
void addParameter (const std::string &name, const std::string &type, const std::string &desc, const T &value)
 
void addDefaultParameters ()
 
void addColumn (const std::string &name, const std::string &type, const std::string &unit, const std::string &desc)
 
void addInfo (const std::string &mode, const size_t &no_row_counts)
 
void writeRow ()
 
void open ()
 
void close ()
 
void writeHeader ()
 Write SDDS header. More...
 
template<typename T >
std::string toString (const T &val)
 
bool hasColumns () const
 
- Protected Attributes inherited from SDDSWriter
std::string fname_m
 
std::ios_base::openmode mode_m
 First write to the statistics output file. More...
 
SDDSColumnSet columns_m
 

Detailed Description

Definition at line 31 of file MemoryProfiler.h.

Member Typedef Documentation

◆ units_t

typedef std::vector<std::string> MemoryProfiler::units_t

Definition at line 39 of file MemoryProfiler.h.

◆ vm_t

typedef std::vector<long double> MemoryProfiler::vm_t

Definition at line 38 of file MemoryProfiler.h.

Member Enumeration Documentation

◆ VirtualMemory

Enumerator
VMPEAK 
VMSIZE 
VMHWM 
VMRSS 
VMDATA 
VMSTK 
VMEXE 
VMLCK 
VMPIN 
VMLIB 
VMPTE 
VMPMD 
VMSWAP 

Definition at line 43 of file MemoryProfiler.h.

Constructor & Destructor Documentation

◆ MemoryProfiler()

MemoryProfiler::MemoryProfiler ( const std::string &  fname,
bool  restart 
)

Definition at line 39 of file MemoryProfiler.cpp.

References procinfo_m, unit_m, and vmem_m.

Member Function Documentation

◆ compute()

void MemoryProfiler::compute ( vm_t vmMin,
vm_t vmMax,
vm_t vmAvg 
)
private

Definition at line 176 of file MemoryProfiler.cpp.

References IpplInfo::getNodes(), new_reduce(), and vmem_m.

Referenced by write().

Here is the call graph for this function:

◆ header()

void MemoryProfiler::header ( )
private

◆ update()

void MemoryProfiler::update ( )
private

Definition at line 144 of file MemoryProfiler.cpp.

References procinfo_m, unit_m, and vmem_m.

Referenced by write().

◆ write()

void MemoryProfiler::write ( const PartBunchBase< double, 3 > *  beam)
overridevirtual

Member Data Documentation

◆ procinfo_m

std::map<std::string, int> MemoryProfiler::procinfo_m
private

Definition at line 69 of file MemoryProfiler.h.

Referenced by MemoryProfiler(), and update().

◆ unit_m

units_t MemoryProfiler::unit_m
private

Definition at line 71 of file MemoryProfiler.h.

Referenced by header(), MemoryProfiler(), and update().

◆ vmem_m

vm_t MemoryProfiler::vmem_m
private

Definition at line 70 of file MemoryProfiler.h.

Referenced by compute(), MemoryProfiler(), update(), and write().


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