PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
Gedim::Profiler Class Reference

#include <IOUtilities.hpp>

Static Public Member Functions

static double GetTime (const std::string &nameTime, const bool &localTime=false)
 
static double GetTime ()
 Get time in ms.
 
static double ComputeTime (const double &startTime, const double &stopTime)
 
static void GetTotalMemory (std::vector< unsigned long > &totalMemory)
 Get Total Physical Memory from file /proc/meminfo (KB)
 
static void GetProcessMemory (std::vector< unsigned long > &memoryUsed)
 Get Current Virtual/Physical Memory used by process (KB)
 
static void CheckMemory (const std::string &nameMemory, const bool &checkProcessesMemory=false)
 Compute the virtual memory used by the process.
 
static void Sleep (const unsigned int &milliseconds)
 Sleep for n milliseconds.
 
static void StartTime (const std::string &nameTime)
 Start time with nameTime if not exist.
 
static void InsertTime (const std::string &nameTime, const double &globalTime, const double &localTime)
 Insert time with nameTime if not exist.
 
static void SplitTime (const std::string &nameTime, double &globalTime, double &localTime)
 Split time with nameTime if exists and return the global time and local time.
 
static double StopTime (const std::string &nameTime, const bool &printTime=true)
 Stop time with nameTime if exists and print to file the result.
 
static void WriteTime (const std::string &nameTime, const double &globalTime, const double &localTime)
 

Static Public Attributes

static bool ActivateProfiler = false
 Compute time for program profiling.
 
static std::string TimeFile = "Time"
 File where time profiling data are stored.
 
static std::string MemoryFile = "Memory"
 File where memory profiling data are stored.
 

Member Function Documentation

◆ CheckMemory()

void Gedim::Profiler::CheckMemory ( const std::string &  nameMemory,
const bool checkProcessesMemory = false 
)
static

◆ ComputeTime()

static double Gedim::Profiler::ComputeTime ( const double startTime,
const double stopTime 
)
inlinestatic

◆ GetProcessMemory()

void Gedim::Profiler::GetProcessMemory ( std::vector< unsigned long > &  memoryUsed)
static

Get Current Virtual/Physical Memory used by process (KB)

Parameters
memoryUsedwill have 2 values: virtual, physical

◆ GetTime() [1/2]

double Gedim::Profiler::GetTime ( )
static

Get time in ms.

◆ GetTime() [2/2]

static double Gedim::Profiler::GetTime ( const std::string &  nameTime,
const bool localTime = false 
)
static

◆ GetTotalMemory()

void Gedim::Profiler::GetTotalMemory ( std::vector< unsigned long > &  totalMemory)
static

Get Total Physical Memory from file /proc/meminfo (KB)

Parameters
totalMemorywill have 3 values: TotMemory, UsedMemory, AvailMemory

◆ InsertTime()

void Gedim::Profiler::InsertTime ( const std::string &  nameTime,
const double globalTime,
const double localTime 
)
static

Insert time with nameTime if not exist.

◆ Sleep()

void Gedim::Profiler::Sleep ( const unsigned int milliseconds)
static

Sleep for n milliseconds.

◆ SplitTime()

void Gedim::Profiler::SplitTime ( const std::string &  nameTime,
double globalTime,
double localTime 
)
static

Split time with nameTime if exists and return the global time and local time.

◆ StartTime()

void Gedim::Profiler::StartTime ( const std::string &  nameTime)
static

Start time with nameTime if not exist.

◆ StopTime()

double Gedim::Profiler::StopTime ( const std::string &  nameTime,
const bool printTime = true 
)
static

Stop time with nameTime if exists and print to file the result.

◆ WriteTime()

void Gedim::Profiler::WriteTime ( const std::string &  nameTime,
const double globalTime,
const double localTime 
)
static

Member Data Documentation

◆ ActivateProfiler

bool Gedim::Profiler::ActivateProfiler = false
static

Compute time for program profiling.

◆ MemoryFile

string Gedim::Profiler::MemoryFile = "Memory"
static

File where memory profiling data are stored.

◆ TimeFile

string Gedim::Profiler::TimeFile = "Time"
static

File where time profiling data are stored.


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