RASPA3 3.0.12
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
|
Stores CPU timing statistics for various Monte Carlo moves. More...
Public Member Functions | |
MCMoveCpuTime () | |
Default constructor. | |
std::chrono::duration< double > | total () const |
Calculates the total CPU time spent on all recorded Monte Carlo moves. | |
void | clearTimingStatistics () |
Resets all timing statistics to zero. | |
const std::string | writeMCMoveCPUTimeStatistics () const |
Writes the CPU time statistics to a string. | |
const std::string | writeMCMoveCPUTimeStatistics (std::size_t componentId, const std::string &componentName) const |
Writes the CPU time statistics for a specific component. | |
const std::string | writeMCMoveCPUTimeStatistics (std::chrono::duration< double > total) const |
Writes the overall CPU time statistics. | |
const nlohmann::json | jsonSystemMCMoveCPUTimeStatistics () const |
Returns the system-level CPU time statistics in JSON format. | |
const nlohmann::json | jsonComponentMCMoveCPUTimeStatistics () const |
Returns the component-level CPU time statistics in JSON format. | |
const nlohmann::json | jsonOverallMCMoveCPUTimeStatistics (std::chrono::duration< double > total) const |
Returns the overall CPU time statistics in JSON format. | |
MCMoveCpuTime (const MCMoveCpuTime &)=default | |
std::map< std::string, std::chrono::duration< double > > & | operator[] (const MoveTypes &move) |
MCMoveCpuTime & | operator= (const MCMoveCpuTime &b) |
MCMoveCpuTime & | operator+= (const MCMoveCpuTime &b) |
Friends | |
Archive< std::ofstream > & | operator<< (Archive< std::ofstream > &archive, const MCMoveCpuTime &t) |
Archive< std::ifstream > & | operator>> (Archive< std::ifstream > &archive, MCMoveCpuTime &t) |
Stores CPU timing statistics for various Monte Carlo moves.
The MCMoveCpuTime struct accumulates the duration of different Monte Carlo moves and their components in a simulation. It provides methods to reset the timings, write the timing statistics to strings, and output them in JSON format.
MCMoveCpuTime::MCMoveCpuTime | ( | ) |
Default constructor.
Initializes all timing statistics to zero.
const nlohmann::json MCMoveCpuTime::jsonComponentMCMoveCPUTimeStatistics | ( | ) | const |
Returns the component-level CPU time statistics in JSON format.
const nlohmann::json MCMoveCpuTime::jsonOverallMCMoveCPUTimeStatistics | ( | std::chrono::duration< double > | total | ) | const |
Returns the overall CPU time statistics in JSON format.
total | The total simulation time. |
const nlohmann::json MCMoveCpuTime::jsonSystemMCMoveCPUTimeStatistics | ( | ) | const |
Returns the system-level CPU time statistics in JSON format.
|
inline |
Calculates the total CPU time spent on all recorded Monte Carlo moves.
const std::string MCMoveCpuTime::writeMCMoveCPUTimeStatistics | ( | ) | const |
Writes the CPU time statistics to a string.
const std::string MCMoveCpuTime::writeMCMoveCPUTimeStatistics | ( | std::chrono::duration< double > | total | ) | const |
Writes the overall CPU time statistics.
total | The total simulation time. |
const std::string MCMoveCpuTime::writeMCMoveCPUTimeStatistics | ( | std::size_t | componentId, |
const std::string & | componentName | ||
) | const |
Writes the CPU time statistics for a specific component.
componentId | The identifier of the component. |
componentName | The name of the component. |