The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
gvt.c File Reference

Global Virtual Time. More...

#include <gvt/gvt.h>
#include <arch/timer.h>
#include <core/init.h>
#include <datatypes/msg_queue.h>
#include <distributed/mpi.h>
#include <log/stats.h>
#include <memory.h>
#include <stdatomic.h>
+ Include dependency graph for gvt.c:

Go to the source code of this file.

Enumerations

enum  thread_phase_t {
  tphase_rdy = 0, tphase_A, tphase_B, tphase_B_reduce,
  tphase_C, tphase_C_reduce, tphase_B_rdone, tphase_C_rdone,
  tphase_B_wait_msgs, tphase_wait
}
 A thread phase during the gvt algorithm computation.
 

Functions

static _Atomic (nid_t)
 
void gvt_global_init (void)
 Initializes the gvt module in the node.
 
static simtime_t gvt_node_reduce (void)
 
void gvt_on_start_ctrl_msg (void)
 Handles a MSG_CTRL_GVT_START control message. More...
 
void gvt_on_done_ctrl_msg (void)
 Handles a MSG_CTRL_GVT_DONE control message. More...
 
simtime_t gvt_phase_run (void)
 
void gvt_on_msg_process (simtime_t msg_t)
 

Variables

static __thread enum thread_phase_t thread_phase = tphase_rdy
 
static timer_uint last_gvt
 
static simtime_t reducing_p [MAX_THREADS]
 
static __thread simtime_t current_gvt
 
static atomic_uint sent_tot [MAX_NODES]
 
atomic_int remote_msg_received [2]
 
static atomic_uint c_a = 0
 

Detailed Description

Global Virtual Time.

Definition in file gvt.c.

Function Documentation

◆ gvt_on_done_ctrl_msg()

void gvt_on_done_ctrl_msg ( void  )

Handles a MSG_CTRL_GVT_DONE control message.

Called by the MPI layer in response to a MSG_CTRL_GVT_DONE control message

Definition at line 158 of file gvt.c.

◆ gvt_on_start_ctrl_msg()

void gvt_on_start_ctrl_msg ( void  )

Handles a MSG_CTRL_GVT_START control message.

Called by the MPI layer in response to a MSG_CTRL_GVT_START control message

Definition at line 145 of file gvt.c.