OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <string.h>
#include <boost/static_assert.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include "Util/MPIHelper.h"
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 ¶ms) |
deserializes params using Boost archive More... | |
void | deserialize (char *buffer, reqVarContainer_t &reqvars) |
void | MPI_Bcast_params (Param_t ¶ms, 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 ¶ms, 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) |
void deserialize | ( | char * | buffer, |
Param_t & | params | ||
) |
deserializes params using Boost archive
Definition at line 44 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 52 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 60 of file MPIHelper.cpp.
References deserialize(), and serialize().
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().
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.
params | parameter list to serialize |
pid | processor ID to send data to |
comm | MPI communicator group used for sending the data |
req | MPI request assigned with the ISend |
Definition at line 105 of file MPIHelper.cpp.
References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().
void MPI_Recv_params | ( | Param_t & | params, |
size_t | pid, | ||
MPI_Comm | comm | ||
) |
Receives and unpacks a parameter list from another (MPI) processor.
params | parameter list to store data |
pid | processor ID to receive data from |
comm | MPI communicator group used for receiving the data |
Definition at line 128 of file MPIHelper.cpp.
References deserialize(), and MPI_EXCHANGE_SERIALIZED_DATA_TAG.
Referenced by Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), Worker< Sim_t >::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and SampleWorker< Sim_t >::onMessage().
void MPI_Recv_reqvars | ( | reqVarContainer_t & | reqvars, |
size_t | pid, | ||
MPI_Comm | comm | ||
) |
Receives and unpacks a required variable list from another (MPI) processor.
reqvars | variable list to store data |
pid | processor ID to receive data from |
comm | MPI communicator group used for receiving the data |
Definition at line 165 of file MPIHelper.cpp.
References deserialize(), and MPI_EXCHANGE_SERIALIZED_DATA_TAG.
Referenced by Sampler::onMessage(), Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage().
void MPI_Send_params | ( | Param_t | params, |
size_t | pid, | ||
MPI_Comm | comm | ||
) |
Serializes a parameter list and sends (MPI) to another processor.
params | parameter list to serialize |
pid | processor ID to send data to |
comm | MPI communicator group used for sending the data |
Definition at line 87 of file MPIHelper.cpp.
References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().
Referenced by Sampler::dispatch_forward_solves(), Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker().
void MPI_Send_reqvars | ( | reqVarContainer_t | reqvars, |
size_t | pid, | ||
MPI_Comm | comm | ||
) |
Serializes requested variable list and sends (MPI) to another processor.
reqvars | variable list list to serialize |
pid | processor ID to send data to |
comm | MPI communicator group used for sending the data |
Definition at line 146 of file MPIHelper.cpp.
References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().
Referenced by Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), Worker< Sim_t >::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and SampleWorker< Sim_t >::onMessage().
void serialize | ( | Param_t | params, |
std::ostringstream & | os | ||
) |
serializes params using Boost archive
Definition at line 32 of file MPIHelper.cpp.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::buildMap(), AmrMultiGrid::buildRestrictionMatrix_m(), MPI_Bcast_params(), MPI_ISend_params(), MPI_Send_params(), MPI_Send_reqvars(), and MPI_Send_serialized().
void serialize | ( | reqVarContainer_t | reqvars, |
std::ostringstream & | os | ||
) |
Definition at line 38 of file MPIHelper.cpp.