![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
Message delivery support. More...
#include <communication/communication.h>
#include <communication/wnd.h>
#include <communication/mpi.h>
Go to the source code of this file.
Functions | |
static size_t | outgoing_queues_size (void) |
Compute the size of all outgoing queues. More... | |
void | outgoing_window_init (void) |
Outgoing queue initialization. More... | |
void | outgoing_window_finalize (void) |
Finalize the message delivery subsystem. More... | |
outgoing_msg * | allocate_outgoing_msg (void) |
Allocate a buffer for an outgoing message node. More... | |
static bool | is_msg_delivered (outgoing_msg *msg) |
Check if a message has been delivered. More... | |
void | store_outgoing_msg (outgoing_msg *out_msg, unsigned int dest_kid) |
Store an outgoing message. More... | |
static int | prune_outgoing_queue (outgoing_queue *oq) |
Prune an outgoing queue. More... | |
int | prune_outgoing_queues (void) |
Prune all outgoing queues. More... | |
Variables | |
static outgoing_queue * | outgoing_queues |
static int | n_queues = 0 |
The number of outgoing queues which are managed by the submodule. | |
Message delivery support.
This module implements the message delivery support functions. Message delivery is carried out asynchronously via MPI, therefore we need a way to let MPI notify us when a certain message has been delivered to the destination simulation kernel and is now in charge of it.
This module implements a set of per-remote-kernel queues in which each remote message is registered before an Isend operation is initiated.
MPI will eventually notify us of the delivery of that message. By scanning the outgoing queues, we can know what messages have reached destination and remove the corresponding entry.
This file is part of ROOT-Sim (ROme OpTimistic Simulator).
ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.
ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file wnd.c.
outgoing_msg* allocate_outgoing_msg | ( | void | ) |
Allocate a buffer for an outgoing message node.
This function allocates a buffer to keep track of one message which is being remotely sent through MPI
Definition at line 130 of file wnd.c.
|
inlinestatic |
Check if a message has been delivered.
Given a message node in an outgoing queue, this function determines whether the corresponding MPI Request tells that the operation is comple, therefore meaning that the message has been delivered to the destination simulation kernel instance.
msg | A pointer to an outgoing_msg to check for delivery |
true
if the message has been delivered, false
otherwise Definition at line 148 of file wnd.c.
|
static |
void outgoing_window_finalize | ( | void | ) |
void outgoing_window_init | ( | void | ) |
|
static |
Prune an outgoing queue.
Given an outgoing queue, this function scans through it looking for all messages which have been correctly delivered to their destination.
The nodes associated with operations which have completed are removed and freed.
oq | The output queue to inspect |
Definition at line 190 of file wnd.c.
int prune_outgoing_queues | ( | void | ) |
Prune all outgoing queues.
This function scans through all the local outgoing queues, looking for messages which have been correctly delivered to the destination.
Such message nodes are removed from the queue.
Actual queue pruning is performed in prune_outgoing_queue()
Definition at line 225 of file wnd.c.
void store_outgoing_msg | ( | outgoing_msg * | out_msg, |
unsigned int | dest_kid | ||
) |
Store an outgoing message.
Given an outgoing_msg node and a destination kernel id, this function properly links the node in out_msg
to the proper outgoing queue associated with the destination kernel.
out_msg | A pointer to an outgoing_msg node |
dest_kid | The global ID of the simulation kernel instance for which this node represents an outgoing message |
Definition at line 167 of file wnd.c.
|
static |
Outgoing queues are used to keep track, at the MPI level, of what messages have been scheduled for asynchronous delivery through MPI. These queues are used to let MPI notify ROOT-Sim that a certain message has been delivered to the destination simulation kernel, and it is now in charge of its management.
We keep one outgoing queue for each remote kernel instance.