|
ADS
Algorithms and Data Structures
|
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 |
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.
| #define MPICH_SKIP_MPICXX 1 |
| #define OMPI_SKIP_MPICXX 1 |