Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::PsLogger Class Reference

Writes output of the system command ps to a logfile. More...

+ Collaboration diagram for Feel::PsLogger:

Public Member Functions

std::string fileName () const
 
void log (std::string logMessage, bool all_procs=true)
 writes the log message and the output of ps to the logfile. More...
 
 PsLogger (std::string fileName, WorldComm const &worldComm=Environment::worldComm(), std::string format="rss pmem pcpu", bool all_procs=true)
 Constructor. More...
 
WorldComm const & worldComm () const
 

Detailed Description

Writes output of the system command ps to a logfile.

Author
Christoph Winkelmann, 2002

Constructor & Destructor Documentation

◆ PsLogger()

Feel::PsLogger::PsLogger ( std::string  fileName,
WorldComm const &  worldComm = Environment::worldComm(),
std::string  format = "rss pmem pcpu",
bool  all_procs = true 
)

Constructor.

Parameters
fileNamename of the logfile
formatthe format of the output of ps. By default, memory consumption (rss), the percentage of real memory used by this process (pmem) and cpu load (pcpu) are logged. See man ps for more information about format specifiers.
all_procs: write on all processors if true

Member Function Documentation

◆ log()

void Feel::PsLogger::log ( std::string  logMessage,
bool  all_procs = true 
)

writes the log message and the output of ps to the logfile.

Parameters
logMessagethe log message to write into the logfile
all_procs: write on all processors if true

References Feel::WorldComm::globalRank(), Feel::Environment::logMemoryUsage(), Feel::WorldComm::masterRank(), and Feel::Environment::worldComm().