ProfilingMonitor< number > Class Template Reference

Developer Documentation: MeltPoolDG::Profiling::ProfilingMonitor< number > Class Template Reference
Developer Documentation
MeltPoolDG::Profiling::ProfilingMonitor< number > Class Template Reference

#include <profiling_monitor.hpp>

Public Member Functions

 ProfilingMonitor (const ProfilingData< number > &data, const TimeIntegration::TimeIterator< number > &time)
 
bool now () const
 
void print (const ConditionalOStream &pcout, const dealii::TimerOutput &timer, const MPI_Comm &mpi_communicator) const
 
void subscribe (const std::function< void(const ConditionalOStream &)> &callback)
 

Private Member Functions

number compute_current_time () const
 

Private Attributes

const ProfilingData< number > & data
 The profiling data struct which contains the relevant information for profiling.
 
const TimeIntegration::TimeIterator< number > & time
 The time iterator which is used to compute the current time.
 
number last_written_time = 0.0
 The time at which the last profiling output was written.
 
std::chrono::time_point< std::chrono::system_clock > real_time_start
 Real time at object construction.
 
boost::signals2::signal< void(const ConditionalOStream &pcout)> notify_signal
 Signal to notify subscribers when profiling output is generated.
 

Constructor & Destructor Documentation

◆ ProfilingMonitor()

template<typename number >
MeltPoolDG::Profiling::ProfilingMonitor< number >::ProfilingMonitor ( const ProfilingData< number > &  data,
const TimeIntegration::TimeIterator< number > &  time 
)

Member Function Documentation

◆ compute_current_time()

template<typename number >
number MeltPoolDG::Profiling::ProfilingMonitor< number >::compute_current_time ( ) const
private

◆ now()

template<typename number >
bool MeltPoolDG::Profiling::ProfilingMonitor< number >::now ( ) const

Returns true if according to the data set in the profiling data struct, profiling outout should be performed. Otherwise, returns false.

◆ print()

template<typename number >
void MeltPoolDG::Profiling::ProfilingMonitor< number >::print ( const ConditionalOStream &  pcout,
const dealii::TimerOutput &  timer,
const MPI_Comm &  mpi_communicator 
) const

Print profiling summary as obtained by the TimerOutput class and statistics summary of all available monitors.

Parameters
pcoutConditionalOStream to print the text.
timerTimerOutput object which contains the profiling information.
mpi_communicatorMPI communicator relevant for the timer.

◆ subscribe()

template<typename number >
void MeltPoolDG::Profiling::ProfilingMonitor< number >::subscribe ( const std::function< void(const ConditionalOStream &)> &  callback)

Subscribe to the profiling monitor. The subscribed callback function will be called whenever profiling output is generated. The idea is to allow other parts of the code to react to profiling output and write there own information to the output stream. The callback function should take a single argument of type ConditionalOStream, which is the output stream to which profiling information is written.

Parameters
callbackThe callback function to be called when profiling output is generated.

Member Data Documentation

◆ data

template<typename number >
const ProfilingData<number>& MeltPoolDG::Profiling::ProfilingMonitor< number >::data
private

The profiling data struct which contains the relevant information for profiling.

◆ last_written_time

template<typename number >
number MeltPoolDG::Profiling::ProfilingMonitor< number >::last_written_time = 0.0
mutableprivate

The time at which the last profiling output was written.

◆ notify_signal

template<typename number >
boost::signals2::signal<void(const ConditionalOStream &pcout)> MeltPoolDG::Profiling::ProfilingMonitor< number >::notify_signal
private

Signal to notify subscribers when profiling output is generated.

◆ real_time_start

template<typename number >
std::chrono::time_point<std::chrono::system_clock> MeltPoolDG::Profiling::ProfilingMonitor< number >::real_time_start
private

Real time at object construction.

◆ time

template<typename number >
const TimeIntegration::TimeIterator<number>& MeltPoolDG::Profiling::ProfilingMonitor< number >::time
private

The time iterator which is used to compute the current time.


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