ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
Enumerations | Functions
stats.h File Reference

Statistics module. More...

#include <core/core.h>
Include dependency graph for stats.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  stats_global_type {
  STATS_GLOBAL_INIT_END , STATS_GLOBAL_EVENTS_START , STATS_GLOBAL_EVENTS_END , STATS_GLOBAL_FINI_START ,
  STATS_GLOBAL_END , STATS_GLOBAL_HR_TOTAL , STATS_GLOBAL_COUNT
}
 The kind of timestamps collected during the simulation execution lifetime. More...
 
enum  stats_thread_type {
  STATS_MSG_PROCESSED , STATS_MSG_PROCESSED_TIME , STATS_ROLLBACK , STATS_RECOVERY_TIME ,
  STATS_MSG_ROLLBACK , STATS_CKPT , STATS_CKPT_TIME , STATS_CKPT_SIZE ,
  STATS_MSG_SILENT , STATS_MSG_SILENT_TIME , STATS_MSG_ANTI , STATS_REAL_TIME_GVT ,
  STATS_COUNT
}
 The kind of samples collected during a simulation run. More...
 

Functions

void stats_global_time_take (enum stats_global_type this_stat)
 Take a lifetime event time value. More...
 
void stats_global_init (void)
 Initializes the stats subsystem in the node.
 
void stats_global_fini (void)
 Finalizes the stats subsystem in the node. More...
 
void stats_init (void)
 Initializes the stats subsystem in the current thread.
 
void stats_take (enum stats_thread_type this_stat, uint_fast64_t c)
 Sum a sample to a statistics value. More...
 
uint64_t stats_retrieve (enum stats_thread_type this_stat)
 Retrieve the value of a metric of this thread. More...
 
void stats_on_gvt (simtime_t current_gvt)
 Perform GVT related activities for the statistics subsystem. More...
 
void stats_dump (void)
 Dump some final minimal statistics on screen.
 

Detailed Description

Statistics module.

All the facilities to collect, gather, and dump statistics are implemented in this module.

Enumeration Type Documentation

◆ stats_global_type

The kind of timestamps collected during the simulation execution lifetime.

Enumerator
STATS_GLOBAL_INIT_END 

Collected when the global data structures of the simulation framework have been initialized.

STATS_GLOBAL_EVENTS_START 

Collected just before actual event processing activities start.

STATS_GLOBAL_EVENTS_END 

Collected right after the last processed message.

STATS_GLOBAL_FINI_START 

Collected when beginning to de-initialize global data structures.

STATS_GLOBAL_END 

Collected at the last possible moment before having to dump statistics.

STATS_GLOBAL_HR_TOTAL 

Collected at the last possible moment before having to dump statistics (high resolution timer)

STATS_GLOBAL_COUNT 

Used to count the members of this enum.

◆ stats_thread_type

The kind of samples collected during a simulation run.

Time samples are collected using high resolution timers

Enumerator
STATS_MSG_PROCESSED 

The count of processed messages.

STATS_MSG_PROCESSED_TIME 

The time spent inside the model dispatcher function.

STATS_ROLLBACK 

The count of rollbacks.

STATS_RECOVERY_TIME 

The time spent for recovery from a rollback: checkpoint restore and anti-message sending activities.

STATS_MSG_ROLLBACK 

The count of rollbacked message, i.e. the already processed messages whose effect has been invalidated.

STATS_CKPT 

The count of taken checkpoints.

STATS_CKPT_TIME 

The time spent in checkpointing activities.

STATS_CKPT_SIZE 

The size of LPs checkpoints.

STATS_MSG_SILENT 

The count of messages processed in coasting forward, i.e. silently executed messages.

STATS_MSG_SILENT_TIME 

The time taken to carry out silent processing activities.

STATS_MSG_ANTI 

The count of generated anti-messages.

STATS_REAL_TIME_GVT 

The real time elapsed since last GVT computation.

STATS_COUNT 

Used to count the members of this enum.

Function Documentation

◆ stats_global_fini()

void stats_global_fini ( void  )

Finalizes the stats subsystem in the node.

When finalizing this subsystem, the master node dumps his statistics from his temporary files onto the final binary file. Then, in a distributed setting, he receives the slaves temporary files, dumping their statistics as well.

◆ stats_global_time_take()

void stats_global_time_take ( enum stats_global_type  this_stat)

Take a lifetime event time value.

Parameters
this_statThe type of event just occurred

◆ stats_on_gvt()

void stats_on_gvt ( simtime_t  gvt)

Perform GVT related activities for the statistics subsystem.

Parameters
gvtthe time value of the current GVT

Dumps accumulated statistics to the file and resets the statistics buffer to ready up for the following processing phase

◆ stats_retrieve()

uint64_t stats_retrieve ( enum stats_thread_type  this_stat)

Retrieve the value of a metric of this thread.

This values are computed since the end of the last GVT.

◆ stats_take()

void stats_take ( enum stats_thread_type  this_stat,
uint_fast64_t  c 
)

Sum a sample to a statistics value.

Parameters
this_statthe statistics type to add the sample to
cthe sample to sum