The ROme OpTimistic Simulator  2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
gvt.h
Go to the documentation of this file.
1 
38 #pragma once
39 
40 #ifdef HAVE_MPI
41 
42 #include <core/core.h>
43 
70 };
71 
76 #define is_red_colour(c) ( (bool) (c & 0x1) )
77 
79 #define in_red_phase() ( is_red_colour(threads_phase_colour[local_tid]) )
80 
82 #define next_colour(c) ( ((c)+1) & 0x3 )
83 
84 extern phase_colour *threads_phase_colour;
85 
87 
88 void gvt_comm_init(void);
89 void gvt_comm_finalize(void);
90 void enter_red_phase(void);
91 void exit_red_phase(void);
92 void join_white_msg_redux(void);
93 bool white_msg_redux_completed(void);
94 void wait_white_msg_redux(void);
95 bool all_white_msg_received(void);
96 void flush_white_msg_recv(void);
97 void flush_white_msg_sent(void);
98 void broadcast_gvt_init(unsigned int round);
99 bool gvt_init_pending(void);
100 void gvt_init_clear(void);
101 void join_gvt_redux(simtime_t local_vt);
102 bool gvt_redux_completed(void);
104 void register_incoming_msg(const msg_t *);
105 void register_outgoing_msg(const msg_t *);
106 
107 #endif /* HAVE_MPI */
phase_colour * threads_phase_colour
Definition: gvt.c:48
void exit_red_phase(void)
Make a thread exit from red phase.
Definition: gvt.c:279
void join_white_msg_redux(void)
Join the white message reduction collective operation.
Definition: gvt.c:301
Color is white (phase 2)
Definition: gvt.h:68
Core ROOT-Sim functionalities.
void gvt_comm_finalize(void)
Shut down the MPI-based distributed GVT reduction submodule.
Definition: gvt.c:221
void register_incoming_msg(const msg_t *)
Register an incoming message, if necessary.
Definition: gvt.c:623
void gvt_comm_init(void)
Initialize the MPI-based distributed GVT reduction submodule.
Definition: gvt.c:174
void join_gvt_redux(simtime_t local_vt)
Reduce the GVT value.
Definition: gvt.c:515
void broadcast_gvt_init(unsigned int round)
Initiate a distributed GVT.
Definition: gvt.c:447
void register_outgoing_msg(const msg_t *)
Register an outgoing message, if necessary.
Definition: gvt.c:589
simtime_t last_reduced_gvt(void)
Return the last GVT value.
Definition: gvt.c:563
bool all_white_msg_received(void)
Check if white messages are all received.
Definition: gvt.c:364
double simtime_t
This defines the type with whom timestamps are represented.
Definition: ROOT-Sim.h:55
bool white_msg_redux_completed(void)
Test completion of white message reduction collective operation.
Definition: gvt.c:328
Color is red (phase 1)
Definition: gvt.h:67
Message Type definition.
Definition: core.h:164
simtime_t * min_outgoing_red_msg
Minimum time among all the outgoing red messages for each thread.
Definition: gvt.c:51
void wait_white_msg_redux(void)
Wait for the completion of wait message reduction.
Definition: gvt.c:349
bool gvt_init_pending(void)
Check if there are pending GVT-init messages around.
Definition: gvt.c:477
void gvt_init_clear(void)
Forcely extract GVT-init message from MPI.
Definition: gvt.c:491
Color is white (phase 1)
Definition: gvt.h:66
void flush_white_msg_recv(void)
Reset received white messages.
Definition: gvt.c:386
_msg_colours
Define colour values for messages and threads.
Definition: gvt.h:65
void enter_red_phase(void)
Make a thread enter into red phase.
Definition: gvt.c:259
void flush_white_msg_sent(void)
Reset sent white messages.
Definition: gvt.c:417
Color is red (phase 2)
Definition: gvt.h:69
bool gvt_redux_completed(void)
Check if final GVT reduction is complete.
Definition: gvt.c:539