ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
BoostMPI.h File Reference

The processes of MPI of a program of Boost.MPI, beyond the book, compiled only with ADS_WITH_MPI and the headers of Boost.MPI: the executor, the sort and the mailbox of the processes [see MPIExecutor.h, DistributedSort.h and MPIMailbox.h] take the communicator of MPI (MPI_Comm), to which a boost::mpi::communicator converts by itself, so that MPIExecutor ex( world ) and distributed::sort( pool , world , A ) need nothing more; the environment of Boost.MPI takes the place of MPIEnvironment when it asks for the funneled level (boost::mpi::threading::funneled), the one that the mailbox needs. More...

#include "ADS/distributed/MPIExecutor.h"
#include "ADS/distributed/MPIMailbox.h"
#include <boost/mpi/communicator.hpp>
#include <boost/mpi/packed_iarchive.hpp>
#include <boost/mpi/packed_oarchive.hpp>
#include <concepts>
#include <cstddef>
#include <cstring>
#include <span>
#include <vector>

Go to the source code of this file.

Classes

struct  ADS::BoostMPICodec< Msg >
 the bytes of a message by Boost.Serialization, in the packed archives of Boost.MPI, for MPICodec< Msg > More...

Namespaces

namespace  ADS

Detailed description

The processes of MPI of a program of Boost.MPI, beyond the book, compiled only with ADS_WITH_MPI and the headers of Boost.MPI: the executor, the sort and the mailbox of the processes [see MPIExecutor.h, DistributedSort.h and MPIMailbox.h] take the communicator of MPI (MPI_Comm), to which a boost::mpi::communicator converts by itself, so that MPIExecutor ex( world ) and distributed::sort( pool , world , A ) need nothing more; the environment of Boost.MPI takes the place of MPIEnvironment when it asks for the funneled level (boost::mpi::threading::funneled), the one that the mailbox needs.

What the header adds is BoostMPICodec< Msg >, the bytes of a message by Boost.Serialization through the packed archives of Boost.MPI (whose representation is that of MPI_Pack(), and therefore holds between processes of different machines), so that a message that a program of Boost.MPI already serializes goes through MPIMailbox by one specialization of MPICodec:

template<> struct ADS::MPICodec< Msg > : ADS::BoostMPICodec< Msg > { };

The program links Boost.MPI and Boost.Serialization (the CMake target ADS::BoostMPI does).

The contracts [see Contract.h]: MPI is initialized while the codec is used; \( \mathit{Msg} \) is default constructible and serializable by Boost.Serialization.

See also
D. Gregor, M. Troyer, Boost.MPI, https://www.boost.org/libs/mpi
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa