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

Autonomic checkpoint interval selection header. More...

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

Go to the source code of this file.

Classes

struct  auto_ckpt
 Structure to keep data used for autonomic checkpointing selection. More...
 

Macros

#define auto_ckpt_register_bad(auto_ckpt)   ((auto_ckpt)->m_bad++)
 
#define auto_ckpt_register_good(auto_ckpt)   ((auto_ckpt)->m_good++)
 
#define auto_ckpt_interval_get(auto_ckpt)   ((auto_ckpt)->ckpt_interval)
 
#define auto_ckpt_is_needed(auto_ckpt)
 

Functions

void auto_ckpt_init (void)
 Initialize the thread-local context for the auto checkpoint module.
 
void auto_ckpt_lp_init (struct auto_ckpt *auto_ckpt)
 Initialize the per-LP context for the auto checkpoint module. More...
 
void auto_ckpt_on_gvt (void)
 Compute the thread-local metrics needed for the per-LP computations. 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...
 

Detailed Description

Autonomic checkpoint interval selection header.

The module which attempts to select the best checkpoint interval

Macro Definition Documentation

◆ auto_ckpt_interval_get

#define auto_ckpt_interval_get (   auto_ckpt)    ((auto_ckpt)->ckpt_interval)

Get the currently computed optimal checkpointing interval

Parameters
auto_ckpta pointer to the auto-checkpoint module struct of the current LP
Returns
the optimal checkpointing interval for the current LP

◆ auto_ckpt_is_needed

#define auto_ckpt_is_needed (   auto_ckpt)
Value:
__extension__({ \
_Bool r = ++(auto_ckpt)->ckpt_rem >= (auto_ckpt)->ckpt_interval; \
if(r) \
(auto_ckpt)->ckpt_rem = 0; \
r; \
})
Structure to keep data used for autonomic checkpointing selection.
Definition: auto_ckpt.h:16

Register a new processed message and check if, for the given LP, a checkpoint is necessary

Parameters
auto_ckpta pointer to the auto-checkpoint module struct of the current LP
Returns
true if the LP needs a checkpoint, false otherwise

◆ auto_ckpt_register_bad

#define auto_ckpt_register_bad (   auto_ckpt)    ((auto_ckpt)->m_bad++)

Register a "bad" message, i.e. one message which cause a rollback

Parameters
auto_ckpta pointer to the auto-checkpoint module struct of the current LP

◆ auto_ckpt_register_good

#define auto_ckpt_register_good (   auto_ckpt)    ((auto_ckpt)->m_good++)

Register a "good" message, i.e. one message processed in forward execution

Parameters
auto_ckpta pointer to the auto-checkpoint module struct of the current LP

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