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

Checkpointing capabilities. More...

#include <mm/buddy/ckpt.h>
#include <core/core.h>
#include <datatypes/array.h>
#include <mm/mm.h>
Include dependency graph for ckpt.c:

Macros

#define buddy_tree_visit(longest, on_visit)
 
#define buddy_block_copy_to_ckp(offset, len)
 
#define buddy_block_copy_from_ckp(offset, len)
 

Functions

struct buddy_checkpointcheckpoint_full_take (const struct buddy_state *self, struct buddy_checkpoint *ret)
 
const struct buddy_checkpointcheckpoint_full_restore (struct buddy_state *self, const struct buddy_checkpoint *ckp)
 

Detailed Description

Checkpointing capabilities.

Macro Definition Documentation

◆ buddy_block_copy_from_ckp

#define buddy_block_copy_from_ckp (   offset,
  len 
)
Value:
__extension__({ \
memcpy(self->base_mem + offset, ptr, len); \
ptr += len; \
})

◆ buddy_block_copy_to_ckp

#define buddy_block_copy_to_ckp (   offset,
  len 
)
Value:
__extension__({ \
memcpy(ptr, self->base_mem + offset, len); \
ptr += len; \
})

◆ buddy_tree_visit

#define buddy_tree_visit (   longest,
  on_visit 
)
Value:
__extension__({ \
bool __vis = false; \
uint_fast8_t __l = B_TOTAL_EXP; \
uint_fast32_t __i = 0; \
while(1) { \
uint_fast8_t __lon = (longest)[__i]; \
if(!__lon) { \
uint_fast32_t __len = 1U << __l; \
uint_fast32_t __o = ((__i + 1) << __l) - (1 << B_TOTAL_EXP); \
on_visit(__o, __len); \
} else if(__lon != __l) { \
__i = buddy_left_child(__i) + __vis; \
__vis = false; \
__l--; \
continue; \
} \
do { \
__vis = !(__i & 1U); \
__i = buddy_parent(__i); \
__l++; \
} while(__vis); \
\
if(__l > B_TOTAL_EXP) \
break; \
__vis = true; \
} \
})