RASPA3 3.0.12
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
Loading...
Searching...
No Matches
MCMoveCpuTime Struct Referenceexport

Stores CPU timing statistics for various Monte Carlo moves. More...

Collaboration diagram for MCMoveCpuTime:

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)
 
MCMoveCpuTimeoperator= (const MCMoveCpuTime &b)
 
MCMoveCpuTimeoperator+= (const MCMoveCpuTime &b)
 

Public Attributes

std::uint64_t versionNumber {2}
 Version number for serialization purposes.
 
std::map< MoveTypes, std::map< std::string, std::chrono::duration< double > > > timingMap
 
std::chrono::duration< double > propertySampling {0.0}
 Time spent on property sampling.
 
std::chrono::duration< double > energyPressureComputation {0.0}
 Time spent on energy and pressure computations.
 
std::chrono::duration< double > pressureFrameworkTime {0.0}
 Time spent on energy and pressure computations.
 
std::chrono::duration< double > pressureIntermolecularTime {0.0}
 Time spent on energy and pressure computations.
 
std::chrono::duration< double > pressureEwaldTime {0.0}
 Time spent on energy and pressure computations.
 
std::chrono::duration< double > pressureTailTime {0.0}
 Time spent on energy and pressure computations.
 
std::chrono::duration< double > pressureRestTime {0.0}
 Time spent on energy and pressure computations.
 

Friends

Archive< std::ofstream > & operator<< (Archive< std::ofstream > &archive, const MCMoveCpuTime &t)
 
Archive< std::ifstream > & operator>> (Archive< std::ifstream > &archive, MCMoveCpuTime &t)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MCMoveCpuTime()

MCMoveCpuTime::MCMoveCpuTime ( )

Default constructor.

Initializes all timing statistics to zero.

Member Function Documentation

◆ jsonComponentMCMoveCPUTimeStatistics()

const nlohmann::json MCMoveCpuTime::jsonComponentMCMoveCPUTimeStatistics ( ) const

Returns the component-level CPU time statistics in JSON format.

Returns
A JSON object containing the component-level timing statistics.

◆ jsonOverallMCMoveCPUTimeStatistics()

const nlohmann::json MCMoveCpuTime::jsonOverallMCMoveCPUTimeStatistics ( std::chrono::duration< double >  total) const

Returns the overall CPU time statistics in JSON format.

Parameters
totalThe total simulation time.
Returns
A JSON object containing the overall timing statistics.

◆ jsonSystemMCMoveCPUTimeStatistics()

const nlohmann::json MCMoveCpuTime::jsonSystemMCMoveCPUTimeStatistics ( ) const

Returns the system-level CPU time statistics in JSON format.

Returns
A JSON object containing the system-level timing statistics.

◆ total()

std::chrono::duration< double > MCMoveCpuTime::total ( ) const
inline

Calculates the total CPU time spent on all recorded Monte Carlo moves.

Returns
The total duration of all moves.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeMCMoveCPUTimeStatistics() [1/3]

const std::string MCMoveCpuTime::writeMCMoveCPUTimeStatistics ( ) const

Writes the CPU time statistics to a string.

Returns
A string containing the timing statistics.

◆ writeMCMoveCPUTimeStatistics() [2/3]

const std::string MCMoveCpuTime::writeMCMoveCPUTimeStatistics ( std::chrono::duration< double >  total) const

Writes the overall CPU time statistics.

Parameters
totalThe total simulation time.
Returns
A string containing the overall timing statistics.

◆ writeMCMoveCPUTimeStatistics() [3/3]

const std::string MCMoveCpuTime::writeMCMoveCPUTimeStatistics ( std::size_t  componentId,
const std::string &  componentName 
) const

Writes the CPU time statistics for a specific component.

Parameters
componentIdThe identifier of the component.
componentNameThe name of the component.
Returns
A string containing the timing statistics for the component.

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