29 #ifndef SC_STATISTICS_H
30 #define SC_STATISTICS_H
51 int min_at_rank, max_at_rank;
52 double average, variance, standev;
53 double variance_mean, standev_mean;
79 double value,
const char *variable);
91 double value,
const char *variable,
93 int stats_group,
int stats_prio);
105 const char *variable);
119 const char *variable,
121 int stats_group,
int stats_prio);
140 int stats_group,
int stats_prio);
197 int full,
int summary);
227 int stats_group,
int stats_prio,
228 int full,
int summary);
259 const char *name,
double value);
265 const char *name,
double value);
274 int package_id,
int log_priority,
275 int full,
int summary);
This file provides a lookup structure for key-value pairs.
struct sc_keyvalue sc_keyvalue_t
The key-value container is an opaque structure.
Definition: sc_keyvalue.h:49
sc3_MPI_Comm_t sc_MPI_Comm
Emulate an MPI communicator.
Definition: sc_mpi.h:450
void sc_statistics_add(sc_statistics_t *stats, const char *name)
Register a statistics variable by name and set its value to 0.
void sc_stats_reset(sc_statinfo_t *stats, int reset_vgp)
Reset all values to zero, optionally unassign name, group, and priority.
void sc_stats_print_ext(int package_id, int log_priority, int nvars, sc_statinfo_t *stats, int stats_group, int stats_prio, int full, int summary)
Print measured statistics, filter by group and/or priority.
void sc_statistics_add_empty(sc_statistics_t *stats, const char *name)
Register a statistics variable by name and set its count to 0.
void sc_stats_accumulate(sc_statinfo_t *stats, double value)
Add an instance of the random variable.
void sc_statistics_set(sc_statistics_t *stats, const char *name, double value)
Set the value of a statistics variable, see sc_stats_set1.
void sc_stats_compute(sc_MPI_Comm mpicomm, int nvars, sc_statinfo_t *stats)
Compute global average and standard deviation.
void sc_stats_init(sc_statinfo_t *stats, const char *variable)
Initialize a sc_statinfo_t structure assuming count=0 and mark it dirty.
int sc_statistics_has(sc_statistics_t *stats, const char *name)
Returns true if the stats include a variable with the given name.
sc_statistics_t * sc_statistics_new(sc_MPI_Comm mpicomm)
Create a new statistics structure that can grow dynamically.
void sc_statistics_destroy(sc_statistics_t *stats)
Destroy a statistics structure.
void sc_stats_set1(sc_statinfo_t *stats, double value, const char *variable)
Populate a sc_statinfo_t structure assuming count=1 and mark it dirty.
void sc_stats_set_group_prio(sc_statinfo_t *stats, int stats_group, int stats_prio)
Set/update the group and priority information for a stats item.
void sc_stats_compute1(sc_MPI_Comm mpicomm, int nvars, sc_statinfo_t *stats)
Version of sc_statistics_statistics that assumes count=1.
void sc_statistics_accumulate(sc_statistics_t *stats, const char *name, double value)
Add an instance of a statistics variable, see sc_stats_accumulate The variable must previously be add...
void sc_stats_init_ext(sc_statinfo_t *stats, const char *variable, int copy_variable, int stats_group, int stats_prio)
Initialize a sc_statinfo_t structure assuming count=0 and mark it dirty.
void sc_stats_set1_ext(sc_statinfo_t *stats, double value, const char *variable, int copy_variable, int stats_group, int stats_prio)
Populate a sc_statinfo_t structure assuming count=1 and mark it dirty.
struct sc_stats sc_statistics_t
The statistics container allows dynamically adding random variables.
void sc_statistics_print(sc_statistics_t *stats, int package_id, int log_priority, int full, int summary)
Print all statistics variables, see sc_stats_print.
const int sc_stats_prio_all
This special group number (negative) will refer to any priority.
const int sc_stats_group_all
This special group number (negative) will refer to any group.
struct sc_statinfo sc_statinfo_t
Store information of one random variable.
void sc_statistics_compute(sc_statistics_t *stats)
Compute statistics for all variables, see sc_stats_compute.
void sc_stats_print(int package_id, int log_priority, int nvars, sc_statinfo_t *stats, int full, int summary)
Print measured statistics.
The sc_array object provides a dynamic array of equal-size elements.
Definition: sc_containers.h:117
Store information of one random variable.
Definition: sc_statistics.h:44
int group
Grouping identifier.
Definition: sc_statistics.h:56
double min
Inout; minimum over values.
Definition: sc_statistics.h:49
const char * variable
Name of the variable for output.
Definition: sc_statistics.h:54
double max
Inout; maximum over values.
Definition: sc_statistics.h:50
double sum_squares
Inout; global sum of squares.
Definition: sc_statistics.h:48
int prio
Priority identifier.
Definition: sc_statistics.h:57
long count
Inout; global count is 52 bit accurate.
Definition: sc_statistics.h:46
int dirty
Only update stats if this is true.
Definition: sc_statistics.h:45
char * variable_owned
NULL or deep copy of variable.
Definition: sc_statistics.h:55
double sum_values
Inout; global sum of values.
Definition: sc_statistics.h:47
The statistics container allows dynamically adding random variables.
Definition: sc_statistics.h:63