KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
|
Distributed counter object. More...
#include <counter.hpp>
Public Types | |
using | DataType = std::int64_t |
Public Member Functions | |
Counter () | |
Constructs a timer using the MPI_COMM_WORLD communicator. | |
Counter (CommunicatorType const &comm) | |
Constructs a timer using a given communicator. | |
void | add (std::string const &name, DataType const &data, std::vector< GlobalAggregationMode > const &global_aggregation_modi=std::vector< GlobalAggregationMode >{}) |
Creates a measurement entry with name. | |
void | append (std::string const &name, DataType const &data, std::vector< GlobalAggregationMode > const &global_aggregation_modi=std::vector< GlobalAggregationMode >{}) |
Looks for a measurement entry with name. | |
auto | aggregate () |
Aggregate the measurement entries globally. | |
void | clear () |
Clears all stored measurements. | |
template<typename Printer > | |
void | aggregate_and_print (Printer &&printer) |
Aggregates and outputs the the executed measurements. The output is done via the print() method of a given Printer object. | |
Distributed counter object.
CommunicatorType | Communicator in which the measurements are executed. |
using kamping::measurements::Counter< CommunicatorType >::DataType = std::int64_t |
Data type of the stored measurements.
|
inline |
Constructs a timer using a given communicator.
comm | Communicator in which the time measurements are executed. |
|
inline |
Creates a measurement entry with name.
name | and stores |
data | therein. If such an entry already exists with associated data entry data_prev , data will be added to it, i.e. data_prev + data . |
global_aggregation_modi | Specify how the measurement entry is aggregated over all participationg PEs when Counter::aggregate() is called. |
|
inline |
Aggregate the measurement entries globally.
|
inline |
Aggregates and outputs the the executed measurements. The output is done via the print() method of a given Printer object.
The print() method must accept an object of type AggregatedTreeNode and receives the root of the evaluated timer tree as parameter. The print() method is only called on the root rank of the communicator. See EvaluationTreeNode for the accessible data. The EvaluationTreeNode::children() member function can be used to navigate the nested measurement structure.
Printer | Type of printer which is used to output the aggregated timing data. Printer must possess a member print() which accepts a EvaluationTreeNode as parameter. |
printer | Printer object used to output the aggregated timing data. |
|
inline |
Looks for a measurement entry with name.
name | and appends |
data | to the list of previously stored data. If no such entry exists, a new measurement entry with data as first entry will be created. entry data_prev , data will be added to it, i.e. data_prev + data . |
global_aggregation_modi | Specify how the measurement entry is aggregated over all participationg PEs when Counter::aggregate() is called. |