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

The processes of MPI as the workers of a distributed computation, beyond the book, compiled only with ADS_WITH_MPI (the CMake option of the same name, OFF by default, and its macro of the makefiles) and an implementation of MPI (Open MPI or MPICH): MPIExecutor holds a communicator and tells the rank of the process and the number of the processes, and run( f ) makes the call f( rank ), the worker of the process, so that a program written for the workers of run() of the executors of threads [see Executor.h] runs with one worker per process, every process calling run(). More...

#include "ADS/Contract.h"
#include <mpi.h>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <stdexcept>
#include <string>
#include <type_traits>

Go to the source code of this file.

Classes

class  ADS::MPIEnvironment
 MPI started for the life of the object, and ended with it. More...
class  ADS::MPIExecutor
 the processes of a communicator, one worker each More...
class  ADS::DistributedMin< T >
 the minimum over the processes of a value of each, by reductions that do not block More...

Namespaces

namespace  ADS

Macros

#define OMPI_SKIP_MPICXX   1
#define MPICH_SKIP_MPICXX   1

Detailed description

The processes of MPI as the workers of a distributed computation, beyond the book, compiled only with ADS_WITH_MPI (the CMake option of the same name, OFF by default, and its macro of the makefiles) and an implementation of MPI (Open MPI or MPICH): MPIExecutor holds a communicator and tells the rank of the process and the number of the processes, and run( f ) makes the call f( rank ), the worker of the process, so that a program written for the workers of run() of the executors of threads [see Executor.h] runs with one worker per process, every process calling run().

MPIEnvironment starts and ends MPI around a program (MPI_Init_thread() with the funneled level, which is what the mailbox of the processes needs [see MPIMailbox.h], and MPI_Finalize()), and DistributedMin is the minimum over the processes of a value of each, e.g., the bound of a search that every process improves, by a reduction that does not block (MPI_Iallreduce), which a process starts and then tests while it works (see Messages, owners and termination).

The contracts [see Contract.h]: MPI is initialized while the objects live; the values of DistributedMin are arithmetic; every process of the communicator starts the same number of reductions of a DistributedMin (a collective operation), and destroys it after the last one completed.

See also
Message Passing Interface Forum, MPI: a message-passing interface standard, version 4.1, 2023, https://www.mpi-forum.org/docs/
T. Hoefler, A. Lumsdaine, W. Rehm, Implementation and performance analysis of non-blocking collective operations for MPI, ACM/IEEE Conference on Supercomputing (SC), 1-10, 2007, doi:10.1145/1362622.1362692
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa

Macro definition documentation

◆ MPICH_SKIP_MPICXX

#define MPICH_SKIP_MPICXX   1

◆ OMPI_SKIP_MPICXX

#define OMPI_SKIP_MPICXX   1