21#include <kassert/kassert.hpp>
24#include "kamping/collectives/barrier.hpp"
25#include "kamping/collectives/gather.hpp"
26#include "kamping/communicator.hpp"
31namespace kamping::measurements {
36template <
typename CommunicatorType = Communicator<>>
41 Counter() : _tree{}, _comm{comm_world()} {}
54 add(std::string
const& name,
66 std::string
const& name,
100 template <
typename Pr
inter>
103 if (_comm.is_root()) {
122 void add_measurement(
123 std::string
const& name,
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32
Distributed counter object.
Definition counter.hpp:37
void aggregate_and_print(Printer &&printer)
Aggregates and outputs the the executed measurements. The output is done via the print() method of a ...
Definition counter.hpp:101
Counter()
Constructs a timer using the MPI_COMM_WORLD communicator.
Definition counter.hpp:41
void clear()
Clears all stored measurements.
Definition counter.hpp:82
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.
Definition counter.hpp:65
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.
Definition counter.hpp:54
auto aggregate()
Aggregate the measurement entries globally.
Definition counter.hpp:76
Counter(CommunicatorType const &comm)
Constructs a timer using a given communicator.
Definition counter.hpp:46
std::int64_t DataType
Definition counter.hpp:39
Counter< Communicator<> > & counter()
Gets a reference to a kamping::measurements::BasicTimer.
Definition counter.hpp:143
Wrapper for MPI functions that don't require a communicator.
LocalAggregationMode
Enum to specify how time measurements with same key shall be aggregated locally.
Definition measurement_aggregation_definitions.hpp:31
Tree consisting of objects of type NodeType. The tree constitutes a hierarchy of measurements such th...
Definition measurement_utils.hpp:278
NodeType * current_node
Pointer to the currently active node of the tree.
Definition measurement_utils.hpp:289