ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
mpi.h
Go to the documentation of this file.
1 
16 #pragma once
17 
19 #include <lp/msg.h>
20 
21 extern void mpi_global_init(int *argc_p, char ***argv_p);
22 extern void mpi_global_fini(void);
23 
24 extern void mpi_remote_msg_send(struct lp_msg *msg, nid_t dest_nid);
25 extern void mpi_remote_anti_msg_send(struct lp_msg *msg, nid_t dest_nid);
26 
27 extern void mpi_control_msg_broadcast(enum msg_ctrl_code ctrl);
28 extern void mpi_control_msg_send_to(enum msg_ctrl_code ctrl, nid_t dest);
29 extern void mpi_remote_msg_handle(void);
30 extern void mpi_remote_msg_drain(void);
31 
32 extern void mpi_reduce_sum_scatter(const uint32_t values[n_nodes], uint32_t *result);
33 extern bool mpi_reduce_sum_scatter_done(void);
34 
35 extern void mpi_reduce_min(double *node_min_p);
36 extern bool mpi_reduce_min_done(void);
37 
38 extern void mpi_node_barrier(void);
39 extern void mpi_blocking_data_send(const void *data, int data_size, nid_t dest);
40 extern void *mpi_blocking_data_rcv(int *data_size_p, nid_t src);
MPI remote control messages header.
msg_ctrl_code
A control message MPI tag value.
Definition: control_msg.h:17
nid_t n_nodes
The total number of MPI nodes in the simulation.
Definition: core.c:14
int nid_t
Used to identify MPI nodes in a distributed environment.
Definition: core.h:72
void mpi_global_init(int *argc_p, char ***argv_p)
Initializes the MPI environment.
Definition: mpi.c:64
void mpi_reduce_min(double *node_min_p)
Computes the min-reduction operation across all nodes.
Definition: mpi.c:293
void mpi_control_msg_send_to(enum msg_ctrl_code ctrl, nid_t dest)
Sends a platform control message to a specific nodes.
Definition: mpi.c:156
void mpi_control_msg_broadcast(enum msg_ctrl_code ctrl)
Sends a platform control message to all the nodes, including self.
Definition: mpi.c:143
bool mpi_reduce_sum_scatter_done(void)
Checks if a previous mpi_reduce_sum_scatter() operation has completed.
Definition: mpi.c:276
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:171
void mpi_remote_msg_drain(void)
Empties the queue of incoming MPI messages, ignoring them.
Definition: mpi.c:216
bool mpi_reduce_min_done(void)
Checks if a previous mpi_reduce_min() operation has completed.
Definition: mpi.c:304
void mpi_blocking_data_send(const void *data, int data_size, nid_t dest)
Sends a byte buffer to another node.
Definition: mpi.c:328
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:130
void mpi_node_barrier(void)
A node barrier.
Definition: mpi.c:314
void * mpi_blocking_data_rcv(int *data_size_p, nid_t src)
Receives a byte buffer from another node.
Definition: mpi.c:341
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:111
void mpi_reduce_sum_scatter(const uint32_t values[n_nodes], uint32_t *result)
Computes the sum-reduction-scatter operation across all nodes.
Definition: mpi.c:267
void mpi_global_fini(void)
Finalizes the MPI environment.
Definition: mpi.c:92
Message management functions.
A model simulation message.
Definition: msg.h:59