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

Termination detection module. More...

#include <gvt/termination.h>
#include <distributed/mpi.h>
#include <lp/lp.h>
Include dependency graph for termination.c:

Functions

void termination_global_init (void)
 Initialize the termination detection module node-wide.
 
void termination_lp_init (struct lp_ctx *lp)
 Initialize the termination detection module LP-wide.
 
void termination_on_msg_process (struct lp_ctx *lp, simtime_t msg_time)
 Compute termination operations after a new message has been processed. More...
 
void termination_on_ctrl_msg (void)
 Compute termination operations after the receipt of a termination control message.
 
void termination_on_gvt (simtime_t current_gvt)
 Update the termination module state after a GVT computation. More...
 
void RootsimStop (void)
 Force termination of the simulation.
 
void termination_on_lp_rollback (struct lp_ctx *lp, simtime_t msg_time)
 Compute termination operations after a LP has been rollbacked. More...
 

Variables

_Atomic nid_t nodes_to_end
 The number of nodes that still need to continue running the simulation.
 
static _Atomic rid_t thr_to_end
 The number of local threads that still need to continue running the simulation.
 
static __thread uint64_t lps_to_end
 The number of thread-locally bounded LPs that still need to continue running the simulation.
 
static __thread simtime_t max_t
 The maximum speculative time at which a thread-local LP declared its intention to terminate. More...
 

Detailed Description

Termination detection module.

Function Documentation

◆ termination_on_gvt()

void termination_on_gvt ( simtime_t  current_gvt)

Update the termination module state after a GVT computation.

Here we check if the simulation, from the point of view of the current thread, can be terminated. If also all the other processing threads on the node are willing to end the simulation, a termination control message is broadcast to the other nodes.

◆ termination_on_lp_rollback()

void termination_on_lp_rollback ( struct lp_ctx lp,
simtime_t  msg_time 
)

Compute termination operations after a LP has been rollbacked.

Parameters
msg_timethe timestamp of the straggler or anti message which caused the rollback

◆ termination_on_msg_process()

void termination_on_msg_process ( struct lp_ctx lp,
simtime_t  msg_time 
)

Compute termination operations after a new message has been processed.

Parameters
msg_timethe timestamp of the freshly processed message

Variable Documentation

◆ max_t

__thread simtime_t max_t
static

The maximum speculative time at which a thread-local LP declared its intention to terminate.

FIXME: a wrong high termination time during a speculative trajectory forces the simulation to uselessly continue