3#ifndef TURBO_STATISTICS_HPP
4#define TURBO_STATISTICS_HPP
8#include "battery/utility.hpp"
9#include "battery/allocator.hpp"
10#include "lala/logic/ast.hpp"
13 printf(
"%% %s=%zu [", key, bytes);
14 if(bytes < 1000 * 1000) {
15 printf(
"%.2fKB",
static_cast<double>(bytes) / 1000);
17 else if(bytes < 1000 * 1000 * 1000) {
18 printf(
"%.2fMB",
static_cast<double>(bytes) / (1000 * 1000));
21 printf(
"%.2fGB",
static_cast<double>(bytes) / (1000 * 1000 * 1000));
79 CUDA
void print_stat(
const char* name,
size_t value)
const {
80 printf(
"%%%%%%mzn-stat: %s=%" PRIu64
"\n", name, value);
83 CUDA
void print_stat(
const char* name,
double value)
const {
84 printf(
"%%%%%%mzn-stat: %s=%lf\n", name, value);
87 CUDA
double to_sec(int64_t dur)
const {
88 return ((
double) dur / 1000.);
93 print_stat(
"nodes",
nodes);
94 print_stat(
"failures",
fails);
99 print_stat(
"solveTime", to_sec(
duration));
108#ifdef TURBO_PROFILE_MODE
115 printf(
"%%%%%%mzn-stat-end\n");
119 printf(
"%%%%%%mzn-stat: objective=");
120 if(is_minimization) {
121 obj.lb().template deinterpret<lala::TFormula<battery::standard_allocator>>().print(
false);
124 obj.ub().template deinterpret<lala::TFormula<battery::standard_allocator>>().print(
false);
130 printf(
"----------\n");
136 printf(
"==========\n");
142 printf(
"=====UNSATISFIABLE=====\n");
145 printf(
"=====UNBOUNDED=====\n");
148 printf(
"=====UNKNOWN=====\n");
void print_memory_statistics(const char *key, size_t bytes)
Definition statistics.hpp:12
Definition statistics.hpp:26
size_t eps_num_subproblems
Definition statistics.hpp:37
size_t fails
Definition statistics.hpp:33
size_t depth_max
Definition statistics.hpp:35
size_t fixpoint_iterations
Definition statistics.hpp:41
CUDA void print_mzn_statistics() const
Definition statistics.hpp:92
Statistics(Statistics &&)=default
size_t num_blocks_done
Definition statistics.hpp:40
size_t constraints
Definition statistics.hpp:28
size_t eps_solved_subproblems
Definition statistics.hpp:38
CUDA void print_mzn_objective(const auto &obj, bool is_minimization) const
Definition statistics.hpp:118
double search_time
Definition statistics.hpp:44
size_t eps_skipped_subproblems
Definition statistics.hpp:39
CUDA Statistics()
Definition statistics.hpp:58
CUDA void meet(const Statistics &other)
Definition statistics.hpp:62
double propagation_time
Definition statistics.hpp:45
int64_t interpretation_duration
Definition statistics.hpp:31
CUDA void print_mzn_end_stats() const
Definition statistics.hpp:114
Statistics(const Statistics &)=default
size_t eliminated_variables
Definition statistics.hpp:42
CUDA void print_mzn_final_separator() const
Definition statistics.hpp:133
CUDA Statistics(size_t variables, size_t constraints, bool optimization)
Definition statistics.hpp:47
size_t nodes
Definition statistics.hpp:32
size_t eliminated_formulas
Definition statistics.hpp:43
size_t solutions
Definition statistics.hpp:34
size_t variables
Definition statistics.hpp:27
int64_t duration
Definition statistics.hpp:30
CUDA void print_mzn_separator() const
Definition statistics.hpp:129
bool optimization
Definition statistics.hpp:29
size_t exhaustive
Definition statistics.hpp:36