Statistics Struct Reference

Developer Documentation: MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics Struct Reference
Developer Documentation
MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics Struct Reference

Public Member Functions

 Statistics (std::string label)
 
void add_info (const unsigned int value)
 
void add_info_with_imbalance (const unsigned int value, MPI_Comm mpi_communicator)
 
number average () const
 
number average_imbalance () const
 
bool has_imbalance () const
 
Statistics get_statistics_across_mpi_ranks (MPI_Comm mpi_communicator) const
 

Public Attributes

const std::string label
 Name of the quantity.
 
unsigned int min = 0
 Minimum over all samples.
 
unsigned int max = 0
 Maximum over all samples.
 
number sum = 0.
 Sum over all samples.
 
uint64_t n_samples = 0
 Number of recorded samples.
 
number imbalance_sum = 0.
 Sum of the load imbalance over all samples recorded via add_info_with_imbalance().
 
uint64_t n_imbalance_samples = 0
 Number of samples recorded via add_info_with_imbalance().
 

Detailed Description

template<int dim, typename number, typename ObstacleType>
struct MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics

A helper struct that represents the statistics of a single unsigned integer quantity over all recorded samples.

Constructor & Destructor Documentation

◆ Statistics()

template<int dim, typename number , typename ObstacleType >
MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::Statistics ( std::string  label)
explicit

Constructor.

Parameters
labelName of the quantity, as shown in the printed table.

Member Function Documentation

◆ add_info()

template<int dim, typename number , typename ObstacleType >
void MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::add_info ( const unsigned int  value)

Records one sample of the quantity on the current MPI rank.

Parameters
valueThe value of the sample.

◆ add_info_with_imbalance()

template<int dim, typename number , typename ObstacleType >
void MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::add_info_with_imbalance ( const unsigned int  value,
MPI_Comm  mpi_communicator 
)

Records one sample of the quantity and the load imbalance of this sample across all MPI ranks. The load imbalance is defined as the maximum of value over all MPI ranks divided by its mean, i.e., a value of 1 means perfectly balanced.

Parameters
valueThe value of the sample on the current MPI rank.
mpi_communicatorMPI communicator over which the load imbalance is computed.
Note
This is a collective operation and must be called on all MPI ranks in the MPI communicator.

◆ average()

template<int dim, typename number , typename ObstacleType >
number MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::average ( ) const

Returns the average over all recorded samples, or 0 if no sample was recorded.

◆ average_imbalance()

template<int dim, typename number , typename ObstacleType >
number MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::average_imbalance ( ) const

Returns the load imbalance averaged over all recorded samples.

Note
Only meaningful if has_imbalance() returns true.

◆ get_statistics_across_mpi_ranks()

template<int dim, typename number , typename ObstacleType >
MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::get_statistics_across_mpi_ranks ( MPI_Comm  mpi_communicator) const

Returns the statistics reduced over all MPI ranks.

Parameters
mpi_communicatorMPI communicator over which the statistics are reduced.
Note
This is a collective operation and must be called on all MPI ranks in the given MPI communicator.

◆ has_imbalance()

template<int dim, typename number , typename ObstacleType >
bool MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::has_imbalance ( ) const

Returns true if samples have been recorded via add_info_with_imbalance().

Member Data Documentation

◆ imbalance_sum

template<int dim, typename number , typename ObstacleType >
number MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::imbalance_sum = 0.

Sum of the load imbalance over all samples recorded via add_info_with_imbalance().

◆ label

template<int dim, typename number , typename ObstacleType >
const std::string MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::label

Name of the quantity.

◆ max

template<int dim, typename number , typename ObstacleType >
unsigned int MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::max = 0

Maximum over all samples.

◆ min

template<int dim, typename number , typename ObstacleType >
unsigned int MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::min = 0

Minimum over all samples.

◆ n_imbalance_samples

template<int dim, typename number , typename ObstacleType >
uint64_t MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::n_imbalance_samples = 0

Number of samples recorded via add_info_with_imbalance().

◆ n_samples

template<int dim, typename number , typename ObstacleType >
uint64_t MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::n_samples = 0

Number of recorded samples.

◆ sum

template<int dim, typename number , typename ObstacleType >
number MeltPoolDG::ParticleMonitor< dim, number, ObstacleType >::Statistics::sum = 0.

Sum over all samples.


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