OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Functions
MPIHelper.cpp File Reference
#include <string.h>
#include <boost/static_assert.hpp>
#include <boost/serialization/map.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include "Util/MPIHelper.h"
Include dependency graph for MPIHelper.cpp:

Go to the source code of this file.

Functions

void serialize (Param_t params, std::ostringstream &os)
 serializes params using Boost archive More...
 
void serialize (reqVarContainer_t reqvars, std::ostringstream &os)
 
void deserialize (char *buffer, Param_t &params)
 deserializes params using Boost archive More...
 
void deserialize (char *buffer, reqVarContainer_t &reqvars)
 
void MPI_Bcast_params (Param_t &params, size_t root, MPI_Comm comm)
 broadcast params to all entities in comm More...
 
void MPI_Send_params (Param_t params, size_t pid, MPI_Comm comm)
 
std::pair< size_t *, char * > MPI_ISend_params (Param_t params, size_t pid, MPI_Comm comm, MPI_Request *req)
 
void MPI_Recv_params (Param_t &params, size_t pid, MPI_Comm comm)
 
void MPI_Send_reqvars (reqVarContainer_t reqvars, size_t pid, MPI_Comm comm)
 
void MPI_Recv_reqvars (reqVarContainer_t &reqvars, size_t pid, MPI_Comm comm)
 

Function Documentation

void deserialize ( char *  buffer,
Param_t params 
)

deserializes params using Boost archive

Definition at line 23 of file MPIHelper.cpp.

Referenced by MPI_Bcast_params(), MPI_Recv_params(), MPI_Recv_reqvars(), and MPI_Recv_serialized().

void deserialize ( char *  buffer,
reqVarContainer_t reqvars 
)

Definition at line 31 of file MPIHelper.cpp.

void MPI_Bcast_params ( Param_t params,
size_t  root,
MPI_Comm  comm 
)

broadcast params to all entities in comm

Definition at line 39 of file MPIHelper.cpp.

References deserialize(), and serialize().

Referenced by SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().

Here is the call graph for this function:

std::pair<size_t*, char*> MPI_ISend_params ( Param_t  params,
size_t  pid,
MPI_Comm  comm,
MPI_Request *  req 
)

Serializes a parameter list and asynchronously sends (MPI) to another processor. The memory associated with returned buffers must be freed by the consumer.

Parameters
paramsparameter list to serialize
pidprocessor ID to send data to
commMPI communicator group used for sending the data
reqMPI request assigned with the ISend

Definition at line 84 of file MPIHelper.cpp.

References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().

Here is the call graph for this function:

void MPI_Recv_params ( Param_t params,
size_t  pid,
MPI_Comm  comm 
)

Receives and unpacks a parameter list from another (MPI) processor.

Parameters
paramsparameter list to store data
pidprocessor ID to receive data from
commMPI communicator group used for receiving the data

Definition at line 107 of file MPIHelper.cpp.

References deserialize(), and MPI_EXCHANGE_SERIALIZED_DATA_TAG.

Referenced by SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage().

Here is the call graph for this function:

void MPI_Recv_reqvars ( reqVarContainer_t reqvars,
size_t  pid,
MPI_Comm  comm 
)

Receives and unpacks a required variable list from another (MPI) processor.

Parameters
reqvarsvariable list to store data
pidprocessor ID to receive data from
commMPI communicator group used for receiving the data

Definition at line 144 of file MPIHelper.cpp.

References deserialize(), and MPI_EXCHANGE_SERIALIZED_DATA_TAG.

Referenced by Sampler::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage().

Here is the call graph for this function:

void MPI_Send_params ( Param_t  params,
size_t  pid,
MPI_Comm  comm 
)

Serializes a parameter list and sends (MPI) to another processor.

Parameters
paramsparameter list to serialize
pidprocessor ID to send data to
commMPI communicator group used for sending the data

Definition at line 66 of file MPIHelper.cpp.

References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().

Referenced by Sampler::dispatch_forward_solves(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker(), and Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker().

Here is the call graph for this function:

void MPI_Send_reqvars ( reqVarContainer_t  reqvars,
size_t  pid,
MPI_Comm  comm 
)

Serializes requested variable list and sends (MPI) to another processor.

Parameters
reqvarsvariable list list to serialize
pidprocessor ID to send data to
commMPI communicator group used for sending the data

Definition at line 125 of file MPIHelper.cpp.

References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().

Referenced by SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage().

Here is the call graph for this function:

void serialize ( Param_t  params,
std::ostringstream &  os 
)
void serialize ( reqVarContainer_t  reqvars,
std::ostringstream &  os 
)

Definition at line 17 of file MPIHelper.cpp.