ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
Macros | Functions | Variables
auto_ckpt.c File Reference

Autonomic checkpoint interval selection module. More...

#include <mm/auto_ckpt.h>
#include <log/stats.h>
#include <lp/process.h>
#include <math.h>
Include dependency graph for auto_ckpt.c:

Macros

#define EXP_AVG(f, old_v, sample)
 

Functions

void auto_ckpt_init (void)
 Initialize the thread-local context for the auto checkpoint module.
 
void auto_ckpt_on_gvt (void)
 Compute the thread-local metrics needed for the per-LP computations. More...
 
void auto_ckpt_lp_init (struct auto_ckpt *auto_ckpt)
 Initialize the per-LP context for the auto checkpoint module. More...
 
void auto_ckpt_recompute (struct auto_ckpt *auto_ckpt, uint_fast32_t state_size)
 Compute the optimal checkpoint interval of the current LP and set it. More...
 

Variables

struct {
   double   ckpt_avg_cost
 
   double   inv_sil_avg_cost
 
ackpt
 

Detailed Description

Autonomic checkpoint interval selection module.

The module which attempts to select the best checkpoint interval

Macro Definition Documentation

◆ EXP_AVG

#define EXP_AVG (   f,
  old_v,
  sample 
)
Value:
__extension__({ \
double s = (sample); \
double o = (old_v); \
o *(((f)-1.0) / (f)) + s *(1.0 / (f)); \
})

Compute a new value of the exponential moving average

Parameters
fthe retention factor for old observations
old_vthe latest value of the moving average
samplethe new value to include in the average
Returns
the new value of the exponential moving average

Function Documentation

◆ auto_ckpt_lp_init()

void auto_ckpt_lp_init ( struct auto_ckpt auto_ckpt)

Initialize the per-LP context for the auto checkpoint module.

Parameters
auto_ckpta pointer to the LP auto checkpoint context to initialize

◆ auto_ckpt_on_gvt()

void auto_ckpt_on_gvt ( void  )

Compute the thread-local metrics needed for the per-LP computations.

This function should be called only at the end of GVT reductions, because the used statistics values are representative only in that moment.

◆ auto_ckpt_recompute()

void auto_ckpt_recompute ( struct auto_ckpt auto_ckpt,
uint_fast32_t  state_size 
)

Compute the optimal checkpoint interval of the current LP and set it.

Parameters
auto_ckpta pointer to the auto checkpoint context of the current LP
state_sizethe size in bytes of the checkpoint-able state of the current LP