9#include <kernel/util/string.hpp>
11#include <kernel/util/kahan_accumulator.hpp>
12#include <kernel/solver/expression.hpp>
83 static std::map<String, std::list<Index>> _overall_iters;
84 static std::map<String, std::list<double>> _overall_mpi_execute_reduction;
85 static std::map<String, std::list<double>> _overall_mpi_execute_blas2;
86 static std::map<String, std::list<double>> _overall_mpi_execute_blas3;
87 static std::map<String, std::list<double>> _overall_mpi_execute_collective;
88 static std::map<String, std::list<double>> _overall_mpi_wait_reduction;
89 static std::map<String, std::list<double>> _overall_mpi_wait_blas2;
90 static std::map<String, std::list<double>> _overall_mpi_wait_blas3;
91 static std::map<String, std::list<double>> _overall_mpi_wait_collective;
94 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_execute_reduction;
95 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_execute_blas2;
96 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_execute_blas3;
97 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_execute_collective;
98 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_wait_reduction;
99 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_wait_blas2;
100 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_wait_blas3;
101 static std::map<String, std::list<std::vector<double>>> _outer_mg_mpi_wait_collective;
160 static String _generate_formatted_solver_tree(
String target);
183 _overall_iters.clear();
184 _overall_mpi_execute_reduction.clear();
185 _overall_mpi_execute_blas2.clear();
186 _overall_mpi_execute_blas3.clear();
187 _overall_mpi_execute_collective.clear();
188 _overall_mpi_wait_reduction.clear();
189 _overall_mpi_wait_blas2.clear();
190 _overall_mpi_wait_blas3.clear();
191 _overall_mpi_wait_collective.clear();
193 _outer_mg_mpi_execute_reduction.clear();
194 _outer_mg_mpi_execute_blas2.clear();
195 _outer_mg_mpi_execute_blas3.clear();
196 _outer_mg_mpi_execute_collective.clear();
197 _outer_mg_mpi_wait_reduction.clear();
198 _outer_mg_mpi_wait_blas2.clear();
199 _outer_mg_mpi_wait_blas3.clear();
200 _outer_mg_mpi_wait_collective.clear();
220 double flops((
double)
_flops);
225 return stringify(flops) +
" GFlop/s [" +
stringify(flops *
double(ranks)) +
" GFlops/s]";
234 inline static void add_time_reduction(
double seconds)
238 inline static void add_time_blas2(
double seconds)
242 inline static void add_time_blas3(
double seconds)
246 inline static void add_time_axpy(
double seconds)
250 inline static void add_time_precon(
double seconds)
254 inline static void add_time_mpi_execute_reduction(
double seconds)
258 inline static void add_time_mpi_execute_blas2(
double seconds)
262 inline static void add_time_mpi_execute_blas3(
double seconds)
266 inline static void add_time_mpi_execute_collective(
double seconds)
270 inline static void add_time_mpi_wait_reduction(
double seconds)
274 inline static void add_time_mpi_wait_blas2(
double seconds)
278 inline static void add_time_mpi_wait_blas3(
double seconds)
282 inline static void add_time_mpi_wait_collective(
double seconds)
287 inline static double get_time_reduction()
291 inline static double get_time_blas2()
295 inline static double get_time_blas3()
299 inline static double get_time_axpy()
303 inline static double get_time_precon()
307 inline static double get_time_mpi_execute_reduction()
311 inline static double get_time_mpi_execute_blas2()
315 inline static double get_time_mpi_execute_blas3()
319 inline static double get_time_mpi_execute_collective()
323 inline static double get_time_mpi_wait_reduction()
327 inline static double get_time_mpi_wait_blas2()
331 inline static double get_time_mpi_wait_blas3()
335 inline static double get_time_mpi_wait_collective()
340 inline static void add_solver_expression(std::shared_ptr<Solver::ExpressionBase> expression)
346 static const std::list<std::shared_ptr<Solver::ExpressionBase>> & get_solver_expressions()
366 return String(
"no solver tree for target '") + target +
"' found";
386 return _overall_iters.at(target);
392 return _overall_mpi_execute_reduction.at(target);
398 return _overall_mpi_execute_blas2.at(target);
404 return _overall_mpi_execute_blas3.at(target);
410 return _overall_mpi_execute_collective.at(target);
416 return _overall_mpi_wait_reduction.at(target);
422 return _overall_mpi_wait_blas2.at(target);
428 return _overall_mpi_wait_blas3.at(target);
434 return _overall_mpi_wait_collective.at(target);
446 return _outer_mg_mpi_execute_reduction.at(target);
452 return _outer_mg_mpi_execute_blas2.at(target);
458 return _outer_mg_mpi_execute_blas3.at(target);
464 return _outer_mg_mpi_execute_collective.at(target);
470 return _outer_mg_mpi_wait_reduction.at(target);
476 return _outer_mg_mpi_wait_blas2.at(target);
482 return _outer_mg_mpi_wait_blas3.at(target);
488 return _outer_mg_mpi_wait_collective.at(target);
Kahan Summation accumulator class template.
DT_ value
the current sum value
void clear()
clears the accumulator, i.e. sets all values to zero
Statistics collection class.
static std::list< Index > & get_iters_schwarz(String target)
retrieve list of all outer schwarz solver call iteration count entries
static std::list< double > & get_time_mpi_execute_blas2(String target)
retrieve list of all overall solver mpi execute blas2 toe entries
static std::list< double > & get_time_mpi_wait_blas2(String target)
retrieve list of all overall solver mpi blas2 wait toe entries
static KahanAccumulator< double > _time_mpi_execute_blas3
global time of execution for mpi related idle/wait tasks of blas-3 operations
static KahanAccumulator< double > _time_precon
global time of execution for special preconditioner kernel type operations
static KahanAccumulator< double > _time_reduction
global time of execution for reduction type operations
static KahanAccumulator< double > _time_mpi_execute_reduction
global time of execution for mpi related idle/wait tasks of (scalar) reduction operations
static std::map< String, String > _formatted_solver_trees
mapping of solver target name to formatted solver tree string
static String get_formatted_solver_tree(String target="default")
Returns a descriptive string of the complete solver tree.
static std::list< double > & get_time_mpi_wait_blas3(String target)
retrieve list of all overall solver mpi blas3 wait toe entries
static std::map< String, std::list< std::vector< double > > > _outer_mg_toe
mapping of solver name to list of outer multigrid level timings. each std::vector holds a complete le...
static Index _flops
global flop counter
static std::list< std::vector< double > > & get_time_mg_mpi_execute_blas3(String target)
retrieve list of all overall solver mpi execute blas3 toe entries per level
static std::map< String, std::list< double > > _outer_schwarz_toe
overall time of outer schwarz preconditioners internal solver
static std::list< double > & get_time_mpi_wait_reduction(String target)
retrieve list of all overall solver mpi reduction wait toe entries
static std::list< double > & get_time_mpi_wait_collective(String target)
retrieve list of all overall solver mpi collective wait toe entries
static std::list< double > & get_time_mpi_execute_collective(String target)
retrieve list of all overall solver mpi execute collective toe entries
static void compress_solver_expressions()
compress solver statistics (toe / defect norm / mpi timings) from previous calls
static KahanAccumulator< double > _time_mpi_execute_blas2
global time of execution for mpi related idle/wait tasks of blas-2 operations
static void reset_times()
Reset all global timer counters.
static String get_formatted_solver_internals(String target="default")
Retrieve formatted timings and iteration counts of internal solver structures for the provided solver...
static std::map< String, std::list< double > > _overall_toe
overall time per reset call per solver name string.
static KahanAccumulator< double > _time_axpy
global time of execution for blas-1 type operations
static std::map< String, std::list< std::shared_ptr< Solver::ExpressionBase > > > _solver_expressions
a consecutive list of all solver actions
static KahanAccumulator< double > _time_mpi_wait_reduction
global time of wait execution for mpi related idle/wait tasks of (scalar) reduction operations
static std::list< double > & get_time_schwarz(String target)
retrieve list of all outer schwarz solver call toe entries
static void add_flops(Index flops)
Add an amount of flops to the global flop counter.
static KahanAccumulator< double > _time_blas2
global time of execution for blas-2 type operations
static std::list< double > & get_time_mpi_execute_blas3(String target)
retrieve list of all overall solver mpi execute blas3 toe entries
static KahanAccumulator< double > _time_mpi_execute_collective
global time of execution for mpi related idle/wait tasks of collective operations (without scalar red...
static std::list< Index > & get_iters(String target)
retrieve list of all overall solver iteration entries
static bool enable_solver_expressions
specifies whether collection of solver expressions is to be enabled
static std::list< std::vector< double > > & get_time_mg(String target)
retrieve list of all overall solver toe entries per mg level
static Index get_flops()
Retrieve current global flop counter.
static std::list< std::vector< double > > & get_time_mg_mpi_execute_collective(String target)
retrieve list of all overall solver mpi execute collective toe entries per level
static KahanAccumulator< double > _time_mpi_wait_collective
global time of wait execution for mpi related idle/wait tasks of collective operations (without scala...
static std::map< String, std::list< Index > > _outer_schwarz_iters
overall iterations of outer schwarz preconditioners internal solver
static std::list< std::vector< double > > & get_time_mg_mpi_wait_collective(String target)
retrieve list of all overall solver mpi collective wait toe entries per level
static KahanAccumulator< double > _time_mpi_wait_blas3
global time of wait execution for mpi related idle/wait tasks of blas3 operations
static std::list< std::vector< double > > & get_time_mg_mpi_execute_blas2(String target)
retrieve list of all overall solver mpi execute blas2 toe entries per level
static KahanAccumulator< double > _time_blas3
global time of execution for blas-3 type operations
static std::list< std::vector< double > > & get_time_mg_mpi_wait_reduction(String target)
retrieve list of all overall solver mpi reduction wait toe entries per level
static String get_formatted_times(double total_time)
Retrieve formatted time consumption overview in percent relative to some provided total time.
static double toe_solve
time of solution in seconds, needs initialization
static void reset()
Reset all internal counters (flops/times/solver_statistics)
static std::list< double > & get_time_toe(String target)
retrieve list of all overall solver toe entries
static std::list< std::vector< double > > & get_time_mg_mpi_execute_reduction(String target)
retrieve list of all overall solver mpi execute reduction toe entries per level
static std::list< std::vector< double > > & get_time_mg_mpi_wait_blas3(String target)
retrieve list of all overall solver mpi blas3 wait toe entries per level
static std::list< std::vector< double > > & get_time_mg_mpi_wait_blas2(String target)
retrieve list of all overall solver mpi blas2 wait toe entries per level
static KahanAccumulator< double > _time_mpi_wait_blas2
global time of wait execution for mpi related idle/wait tasks of blas2 operations
static void print_solver_expressions()
print out the complete solver expression list
static String get_formatted_flops(double seconds, int ranks=1)
Retrieve formatted flops per second string.
static String expression_target
the current solver's descriptive string
static double toe_partition
time of partitioning in seconds, needs initialization
static void reset_flops()
Reset global flop counter.
static std::list< double > & get_time_mpi_execute_reduction(String target)
retrieve list of all overall solver mpi execute reduction toe entries
static double toe_assembly
time of assembly in seconds, needs initialization
String class implementation.
String stringify(const T_ &item)
Converts an item into a String.
std::uint64_t Index
Index data type.