TRIQS/mpi 1.3.0
C++ interface to MPI
Loading...
Searching...
No Matches
optional.hpp
#include "./communicator.hpp"
#include "./generic_communication.hpp"
#include "./macros.hpp"
#include <mpi.h>
#include <optional>
#include <concepts>

Detailed Description

Provides an MPI broadcast and reduce for std::optional.

Definition in file optional.hpp.

Go to the source code of this file.

Functions

template<std::default_initializable T>
void mpi::mpi_broadcast (std::optional< T > &opt, communicator c={}, int root=0)
 Implementation of an MPI broadcast for a std::optional.
template<typename T1, std::default_initializable T2>
void mpi::mpi_reduce_into (std::optional< T1 > const &opt_in, std::optional< T2 > &opt_out, communicator c={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
 Implementation of an MPI reduce for a std::optional that reduces directly into a given output optional.