The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
mpi.h
Go to the documentation of this file.
1 
16 #pragma once
17 
18 #ifdef ROOTSIM_MPI
19 
20 #include <lp/msg.h>
21 
30 };
31 
32 extern void mpi_global_init(int *argc_p, char ***argv_p);
33 extern void mpi_global_fini(void);
34 
35 extern void mpi_remote_msg_send(struct lp_msg *msg, nid_t dest_nid);
36 extern void mpi_remote_anti_msg_send(struct lp_msg *msg, nid_t dest_nid);
37 
38 extern void mpi_control_msg_broadcast(enum msg_ctrl_tag ctrl);
39 extern void mpi_control_msg_send_to(enum msg_ctrl_tag ctrl, nid_t dest);
40 extern void mpi_remote_msg_handle(void);
41 
42 extern void mpi_reduce_sum_scatter(const unsigned node_vals[n_nodes], unsigned *result);
43 extern bool mpi_reduce_sum_scatter_done(void);
44 
45 extern void mpi_reduce_min(simtime_t *node_min_p);
46 extern bool mpi_reduce_min_done(void);
47 
48 extern void mpi_node_barrier(void);
49 extern void mpi_blocking_data_send(const void *data, int data_size, nid_t dest);
50 extern void *mpi_blocking_data_rcv(int *data_size_p, nid_t src);
51 
52 #endif
simtime_t
double simtime_t
The type used to represent logical time in the simulation.
Definition: core.h:62
mpi_remote_msg_handle
void mpi_remote_msg_handle(void)
Empties the queue of incoming MPI messages, doing the right thing for each one of them.
Definition: mpi.c:218
mpi_blocking_data_send
void mpi_blocking_data_send(const void *data, int data_size, nid_t dest)
Sends a byte buffer to another node.
Definition: mpi.c:381
msg_ctrl_tag
msg_ctrl_tag
A control message MPI tag value.
Definition: mpi.h:23
MSG_CTRL_GVT_DONE
@ MSG_CTRL_GVT_DONE
Used by slaves to signal their completion of the gvt protocol.
Definition: mpi.h:27
MSG_CTRL_GVT_START
@ MSG_CTRL_GVT_START
Used by the master to start a new gvt reduction operation.
Definition: mpi.h:25
mpi_control_msg_send_to
void mpi_control_msg_send_to(enum msg_ctrl_tag ctrl, nid_t dest)
Sends a platform control message to a specific nodes.
Definition: mpi.c:199
nid_t
int nid_t
Used to identify MPI nodes in a distributed environment.
Definition: core.h:79
mpi_node_barrier
void mpi_node_barrier(void)
A node barrier.
Definition: mpi.c:365
lp_msg
A model simulation message.
Definition: msg.h:34
msg.h
Message management functions.
lp_msg::dest
lp_id_t dest
The id of the recipient LP.
Definition: msg.h:36
mpi_reduce_min
void mpi_reduce_min(simtime_t *node_min_p)
Computes the min-reduction operation across all nodes.
Definition: mpi.c:339
mpi_control_msg_broadcast
void mpi_control_msg_broadcast(enum msg_ctrl_tag ctrl)
Sends a platform control message to all the other nodes.
Definition: mpi.c:180
mpi_reduce_sum_scatter_done
bool mpi_reduce_sum_scatter_done(void)
Checks if a previous mpi_reduce_sum_scatter() operation has completed.
Definition: mpi.c:315
MSG_CTRL_TERMINATION
@ MSG_CTRL_TERMINATION
Used in broadcast to signal that local LPs can terminate.
Definition: mpi.h:29
mpi_reduce_min_done
bool mpi_reduce_min_done(void)
Checks if a previous mpi_reduce_min() operation has completed.
Definition: mpi.c:353
mpi_reduce_sum_scatter
void mpi_reduce_sum_scatter(const unsigned node_vals[n_nodes], unsigned *result)
Computes the sum-reduction-scatter operation across all nodes.
Definition: mpi.c:303
mpi_global_fini
void mpi_global_fini(void)
Finalizes the MPI environment.
Definition: mpi.c:117
mpi_remote_msg_send
void mpi_remote_msg_send(struct lp_msg *msg, nid_t dest_nid)
Sends a model message to a LP residing on another node.
Definition: mpi.c:138
mpi_blocking_data_rcv
void * mpi_blocking_data_rcv(int *data_size_p, nid_t src)
Receives a byte buffer from another node.
Definition: mpi.c:397
mpi_remote_anti_msg_send
void mpi_remote_anti_msg_send(struct lp_msg *msg, nid_t dest_nid)
Sends a model anti-message to a LP residing on another node.
Definition: mpi.c:163
mpi_global_init
void mpi_global_init(int *argc_p, char ***argv_p)
Initializes the MPI environment.
Definition: mpi.c:77