KaMPIng 0.1.0
(Near) zero-overhead C++ MPI bindings.
Loading...
Searching...
No Matches
environment.hpp File Reference

Wrapper for MPI functions that don't require a communicator. More...

#include <vector>
#include <kassert/kassert.hpp>
#include <mpi.h>
#include "kamping/assertion_levels.hpp"
#include "kamping/checking_casts.hpp"
#include "kamping/error_handling.hpp"
#include "kamping/span.hpp"

Go to the source code of this file.

Classes

class  kamping::Environment< init_finalize_mode >
 Wrapper for MPI functions that don't require a communicator. If the template parameter init_finalize_mode is set to InitMPIMode::InitFinalize (default), MPI_Init is called in the constructor, and MPI_Finalize is called in the destructor. More...
 

Namespaces

namespace  kamping::internal
 Internal namespace marking the code that is not user-facing.
 

Enumerations

enum class  kamping::InitMPIMode { InitFinalize , NoInitFinalize , InitFinalizeIfNecessary }
 Configuration for the behavior of the constructors and destructor of kamping::Environment. More...
 

Variables

std::vector< MPI_Datatypekamping::internal::registered_mpi_types
 A global list of MPI data types registered to KaMPIng.
 
Environment< InitMPIMode::NoInitFinalize > const kamping::mpi_env
 A global environment object to use when you don't want to create a new Environment object.
 

Detailed Description

Wrapper for MPI functions that don't require a communicator.

Enumeration Type Documentation

◆ InitMPIMode

enum class kamping::InitMPIMode
strong

Configuration for the behavior of the constructors and destructor of kamping::Environment.

Enumerator
InitFinalize 

Call MPI_Init in the constructor of Environment.

NoInitFinalize 

Do not call MPI_Init in the constructor of Environment.

InitFinalizeIfNecessary 

Call MPI_Init in the constructor of Environment if MPI_Init has not been called before. Call MPI_Finalize in the destructor of Environment if MPI_Init was called in the constructor.

Variable Documentation

◆ mpi_env

Environment<InitMPIMode::NoInitFinalize> const kamping::mpi_env
inline

A global environment object to use when you don't want to create a new Environment object.

Note that inline const results in external linkage since C++17 (see https://en.cppreference.com/w/cpp/language/inline).