23f64 shammodels::SolverLog::get_last_rate() {
25 if (step_logs.size() == 0) {
29 u64 last_id = step_logs.size() - 1;
31 u64 obj_loc = step_logs[last_id].rank_count;
32 f64 time_loc = step_logs[last_id].elasped_sec;
34 u64 obj_total = shamalgs::collective::allreduce_sum(obj_loc);
35 f64 max_t = shamalgs::collective::allreduce_max(time_loc);
37 return f64(obj_total) / max_t;
40u64 shammodels::SolverLog::get_last_obj_count() {
42 if (step_logs.size() == 0) {
46 u64 last_id = step_logs.size() - 1;
48 u64 cnt_loc = step_logs[last_id].rank_count;
50 u64 cnt_tot = shamalgs::collective::allreduce_sum(cnt_loc);
55shamsys::SystemMetrics shammodels::SolverLog::get_last_system_metrics() {
57 if (step_logs.size() == 0) {
61 auto &last_log = step_logs.back();
63 auto rank_metrics = shamsys::gather_rank_metrics(last_log.system_metrics);
64 return shamsys::aggregate_rank_metrics(rank_metrics);
double f64
Alias for double.
std::uint64_t u64
64 bit unsigned integer
This header file contains utility functions related to exception handling in the code.
ExcptTypes make_except_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Create an exception with a message and a location.