ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
auto_ckpt.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <inttypes.h>
14 
16 struct auto_ckpt {
18  double inv_bad_p;
20  unsigned m_bad;
22  unsigned m_good;
24  unsigned ckpt_interval;
26  unsigned ckpt_rem;
27 };
28 
33 #define auto_ckpt_register_bad(auto_ckpt) ((auto_ckpt)->m_bad++)
34 
39 #define auto_ckpt_register_good(auto_ckpt) ((auto_ckpt)->m_good++)
40 
46 #define auto_ckpt_interval_get(auto_ckpt) ((auto_ckpt)->ckpt_interval)
47 
53 #define auto_ckpt_is_needed(auto_ckpt) \
54  __extension__({ \
55  _Bool r = ++(auto_ckpt)->ckpt_rem >= (auto_ckpt)->ckpt_interval; \
56  if(r) \
57  (auto_ckpt)->ckpt_rem = 0; \
58  r; \
59  })
60 
61 extern void auto_ckpt_init(void);
62 extern void auto_ckpt_lp_init(struct auto_ckpt *auto_ckpt);
63 extern void auto_ckpt_on_gvt(void);
64 extern void auto_ckpt_recompute(struct auto_ckpt *auto_ckpt, uint_fast32_t state_size);
void auto_ckpt_on_gvt(void)
Compute the thread-local metrics needed for the per-LP computations.
Definition: auto_ckpt.c:52
void auto_ckpt_lp_init(struct auto_ckpt *auto_ckpt)
Initialize the per-LP context for the auto checkpoint module.
Definition: auto_ckpt.c:73
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.
Definition: auto_ckpt.c:85
void auto_ckpt_init(void)
Initialize the thread-local context for the auto checkpoint module.
Definition: auto_ckpt.c:40
Structure to keep data used for autonomic checkpointing selection.
Definition: auto_ckpt.h:16
unsigned m_bad
The count of straggler and anti-messages.
Definition: auto_ckpt.h:20
unsigned ckpt_rem
The count of remaining events to process until the next checkpoint.
Definition: auto_ckpt.h:26
double inv_bad_p
The inverse of the rollback probability.
Definition: auto_ckpt.h:18
unsigned m_good
The count of correctly processed forward messages.
Definition: auto_ckpt.h:22
unsigned ckpt_interval
The currently selected checkpointing interval.
Definition: auto_ckpt.h:24