ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
termination.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include <core/core.h>
12 #include <lp/lp.h>
13 
14 #include <stdatomic.h>
15 
16 extern _Atomic nid_t nodes_to_end;
17 
22 #define termination_cant_end() (atomic_load_explicit(&nodes_to_end, memory_order_relaxed) > 0)
23 
24 extern void termination_global_init(void);
25 extern void termination_lp_init(struct lp_ctx *lp);
26 extern void termination_on_msg_process(struct lp_ctx *lp, simtime_t msg_time);
27 extern void termination_on_gvt(simtime_t current_gvt);
28 extern void termination_on_lp_rollback(struct lp_ctx *lp, simtime_t msg_time);
29 extern void termination_on_ctrl_msg(void);
30 extern void termination_force(void);
double simtime_t
Simulation time data type.
Definition: ROOT-Sim.h:27
Core ROOT-Sim functionalities.
int nid_t
Used to identify MPI nodes in a distributed environment.
Definition: core.h:72
LP construction functions.
A complete LP context.
Definition: lp.h:22
void termination_on_gvt(simtime_t current_gvt)
Update the termination module state after a GVT computation.
Definition: termination.c:73
void termination_on_ctrl_msg(void)
Compute termination operations after the receipt of a termination control message.
Definition: termination.c:61
void termination_on_msg_process(struct lp_ctx *lp, simtime_t msg_time)
Compute termination operations after a new message has been processed.
Definition: termination.c:47
void termination_on_lp_rollback(struct lp_ctx *lp, simtime_t msg_time)
Compute termination operations after a LP has been rollbacked.
Definition: termination.c:102
void termination_global_init(void)
Initialize the termination detection module node-wide.
Definition: termination.c:27
_Atomic nid_t nodes_to_end
The number of nodes that still need to continue running the simulation.
Definition: termination.c:15
void termination_lp_init(struct lp_ctx *lp)
Initialize the termination detection module LP-wide.
Definition: termination.c:36