FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Dist::Comm Class Reference

Communicator class. More...

#include <dist.hpp>

Public Member Functions

 Comm ()
 Standard constructor. More...
 
 Comm (Comm &&other)
 Move constructor. More...
 
 Comm (const Comm &)=delete
 communicators are non-copyable
 
 Comm (MPI_Comm comm_)
 MPI_Comm handle constructor More...
 
virtual ~Comm ()
 virtual destructor More...
 
bool is_null () const
 Checks whether this communicator is a null communicator. More...
 
bool is_self () const
 Checks whether this communicator is the self communicator. More...
 
bool is_world () const
 Checks whether this communicator is the world communicator. More...
 
MPI_Comm & mpi_comm ()
 
const MPI_Comm & mpi_comm () const
 
Commoperator= (Comm &&other)
 Move-assignment operator. More...
 
Commoperator= (const Comm &)=delete
 communicators are non-copyable
 
int rank () const
 Returns the rank of this process in this communicator. More...
 
int size () const
 Returns the size of this communicator. More...
 
Comm Creation
Comm comm_dup () const
 Creates a copy of this communicator. More...
 
Comm comm_create_range_incl (int count, int first=0, int stride=1) const
 Creates a new sub-communicator from a strided range of ranks. More...
 
Comm comm_create_incl (int n, const int *ranks) const
 Creates a new sub-communicator for a given set of ranks. More...
 
Comm comm_split (int color, int key) const
 Creates a new sub-communicator by splitting this communicator. More...
 
Barrier Synchronization
void barrier () const
 Blocking barrier. More...
 
Request ibarrier () const
 Nonblocking barrier. More...
 
Point-To-Point Communication (Blocking)
void send (const void *buffer, std::size_t count, const Datatype &datatype, int dest, int tag=0) const
 Blocking Send. More...
 
template<typename T_ >
void send (const T_ *buffer, std::size_t count, int dest, int tag=0) const
 Blocking Send. More...
 
void recv (void *buffer, std::size_t count, const Datatype &datatype, int source, int tag, Status &status) const
 Blocking Receive. More...
 
void recv (void *buffer, std::size_t count, const Datatype &datatype, int source, int tag=0) const
 Blocking Receive. More...
 
template<typename T_ >
void recv (T_ *buffer, std::size_t count, int source, int tag, Status &status) const
 Blocking Receive. More...
 
template<typename T_ >
void recv (T_ *buffer, std::size_t count, int source, int tag=0) const
 Blocking Receive. More...
 
Point-To-Point Communication (Nonblocking)
Request isend (const void *buffer, std::size_t count, const Datatype &datatype, int dest, int tag=0) const
 Nonblocking Send. More...
 
template<typename T_ >
Request isend (const T_ *buffer, std::size_t count, int dest, int tag=0) const
 Nonblocking Send. More...
 
Request irecv (void *buffer, std::size_t count, const Datatype &datatype, int source, int tag=0) const
 Nonblocking Receive. More...
 
template<typename T_ >
Request irecv (T_ *buffer, std::size_t count, int source, int tag=0) const
 Nonblocking Receive. More...
 
Broadcasts
void bcast (void *buffer, std::size_t count, const Datatype &datatype, int root) const
 Blocking broadcast. More...
 
template<typename T_ >
void bcast (T_ *buffer, std::size_t count, int root) const
 Blocking broadcast. More...
 
Request ibcast (void *buffer, std::size_t count, const Datatype &datatype, int root) const
 Nonblocking broadcast. More...
 
template<typename T_ >
Request ibcast (T_ *buffer, std::size_t count, int root) const
 Nonblocking broadcast. More...
 
Gather and Scatter
void gather (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype, int root) const
 Blocking gather. More...
 
template<typename ST_ , typename RT_ >
void gather (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount, int root) const
 Blocking gather. More...
 
Request igather (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype, int root) const
 Nonblocking gather. More...
 
template<typename ST_ , typename RT_ >
Request igather (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount, int root) const
 Nonblocking gather. More...
 
void scatter (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype, int root) const
 Blocking scatter. More...
 
template<typename ST_ , typename RT_ >
void scatter (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount, int root) const
 Blocking scatter. More...
 
Request iscatter (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype, int root) const
 Nonblocking scatter. More...
 
template<typename ST_ , typename RT_ >
Request iscatter (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount, int root) const
 Nonblocking scatter. More...
 
void allgather (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype) const
 Blocking gather-to-all. More...
 
template<typename ST_ , typename RT_ >
void allgather (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount) const
 Blocking gather-to-all. More...
 
Request iallgather (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype) const
 Nonblocking gather-to-all. More...
 
template<typename ST_ , typename RT_ >
Request iallgather (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount) const
 Nonblocking gather-to-all. More...
 
void allgatherv (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, const int *recvcounts, const int *displs, const Datatype &recvtype) const
 Blocking gather-to-all. More...
 
template<typename ST_ , typename RT_ >
void allgatherv (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, const int *recvcounts, const int *displs) const
 Blocking gather-to-all. More...
 
void alltoall (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype) const
 Blocking All-to-All Scatter/Gather. More...
 
template<typename ST_ , typename RT_ >
void alltoall (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount) const
 Blocking All-to-All Scatter/Gather. More...
 
Request ialltoall (const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype) const
 Nonblocking All-to-All Scatter/Gather. More...
 
template<typename ST_ , typename RT_ >
Request ialltoall (const ST_ *sendbuf, std::size_t sendcount, RT_ *recvbuf, std::size_t recvcount) const
 Nonblocking All-to-All Scatter/Gather. More...
 
void alltoallv (const void *sendbuf, const int *sendcounts, const int *sdispls, const Datatype &sendtype, void *recvbuf, const int *recvcounts, const int *rdispls, const Datatype &recvtype) const
 Blocking All-to-All Scatter/Gather. More...
 
template<typename ST_ , typename RT_ >
void alltoallv (const ST_ *sendbuf, const int *sendcounts, const int *sdispls, RT_ *recvbuf, const int *recvcounts, const int *rdispls) const
 Blocking All-to-All Scatter/Gather. More...
 
Reductions and Scans
void reduce (const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op, int root) const
 Blocking Reduce. More...
 
template<typename T_ >
void reduce (const T_ *sendbuf, T_ *recvbuf, std::size_t count, const Operation &op, int root) const
 Blocking Reduce. More...
 
Request ireduce (const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op, int root) const
 Nonblocking Reduce. More...
 
template<typename T_ >
Request ireduce (const T_ *sendbuf, T_ *recvbuf, std::size_t count, const Operation &op, int root) const
 Nonblocking Reduce. More...
 
void allreduce (const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
 Blocking All-Reduce. More...
 
template<typename T_ >
void allreduce (const T_ *sendbuf, T_ *recvbuf, std::size_t count, const Operation &op) const
 Blocking All-Reduce. More...
 
Request iallreduce (const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
 Nonblocking All-Reduce. More...
 
template<typename T_ >
Request iallreduce (const T_ *sendbuf, T_ *recvbuf, std::size_t count, const Operation &op) const
 Nonblocking All-Reduce. More...
 
void scan (const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
 Blocking Inclusive Scan. More...
 
template<typename T_ >
void scan (const T_ *sendbuf, T_ *recvbuf, std::size_t count, const Operation &op) const
 Blocking Inclusive Scan. More...
 
void exscan (const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
 Blocking Exclusive Scan. More...
 
template<typename T_ >
void exscan (const T_ *sendbuf, T_ *recvbuf, std::size_t count, const Operation &op) const
 Blocking Exclusive Scan. More...
 
Extended and derived communications

The following function are not mere wrappers for MPI functions, but implement more complex utility tasks.

void bcast_stringstream (std::stringstream &stream, int root=0) const
 Blocking broadcast of a std::stringstream. More...
 
void bcast_binarystream (BinaryStream &stream, int root=0) const
 Blocking broadcast of a BinaryStream. More...
 
void print (std::ostream &os, const String &msg, int root=0) const
 Prints a message line to an output stream. More...
 
void print (const String &msg, int root=0) const
 Prints a message line to the standard output stream cout. More...
 
void allprint (std::ostream &os, const String &msg, int root=0) const
 Prints the ordered messages of all processes to an output stream. More...
 
void allprint (const String &msg, int root=0) const
 Prints the ordered messages of all processes to the standard output stream cout. More...
 
void print_flush (std::ostream &os, int root=0) const
 Explicitly flushes the output stream. More...
 
void print_flush (int root=0) const
 Explicitly flushes cout. More...
 

Static Public Member Functions

static Comm null ()
 Returns a null communicator. More...
 
static Comm self ()
 Returns a copy of the self communicator. More...
 
static Comm world ()
 Returns a copy of the world communicator. More...
 

Public Attributes

MPI_Comm comm
 our MPI communicator handle More...
 

Protected Attributes

int _rank
 our rank More...
 
int _size
 the communicator size More...
 

Detailed Description

Communicator class.

This class effectively wraps around the MPI_Comm handle and contains wrapper functions for many (but not all) MPI functions, which work on communicators, most notably all message passing functions.

Note
The documentation of this class is related to parallel MPI builds. For non-MPI builds, this class offers corresponding serial implementations, which behave just as if they were called for a MPI build with a world consisting of exactly 1 process. In many cases, the corresponding serial version is an empty function, whereas in some other cases, a memcpy between the source and receive buffers has to be performed.

The wrapper functions provided by this class are written in accordance with the following guidelines:

  • All function names correspond to their MPI function names in lowercase without the MPI_ prefix.
  • All functions, which do not return a Request object, are of return type void.
  • Function arguments have the same semantics and the same order as their MPI counterparts. In almost all cases, the function argument names also coincide.
  • The comm argument is removed, as it is given by this Comm object itself.
  • All size/count arguments are of type std::size_t rather than int.
    Exception: Arguments that are arrays of sizes/counts/displacements, are of type int for technical reasons, e.g. allgatherv or alltoallv.
  • All MPI_Datatype handle arguments are replaced by references to Dist::Datatype objects.
  • All MPI_Op handle arguments are replaced by references to Dist::Operation objects.
  • All MPI_Status pointer arguments are replaced by references to Dist::Status objects.
  • All output MPI_Request pointer arguments are removed, as nonblocking operations return a Dist::Request object representing the request.
  • All tag arguments are defaulted to 0, unless there exists another non-defaulted argument following the tag argument, of course.

Furthermore, this class offers additional overloads for many of the "pure" wrapper functions:

  • For each function, which has at least one Datatype argument, there exists an overloaded template wrapper function, which automatically deducts the datatype(s) by using Dist::autotype. Of course, these overloads work only for arguments of fundamental C/C++ datatypes. For these overloads, the datatype arguments are removed.

Examples:

  1. The blocking receive function has the following MPI prototype:
    int MPI_Recv(void* buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status)
    MPI_Comm comm
    our MPI communicator handle
    Definition: dist.hpp:1353
    The corresponding wrapper function for is the Dist::Comm::recv() member function:
    void recv(void* buf, std::size_t count, const Datatype& datatype, int source, int tag, Status& status) const
    void recv(void *buffer, std::size_t count, const Datatype &datatype, int source, int tag, Status &status) const
    Blocking Receive.
    Definition: dist.cpp:711
    Communication Status class.
    Definition: dist.hpp:295
    Communication Datatype class.
    Definition: dist.hpp:75
    The overloaded wrapper function template with automatic type deduction is:
    template<typename T_>
    void recv(T_* buffer, std::size_t count, int source, int tag, Status& status) const
  2. The nonblocking reduce function has the following MPI prototype:
    int MPI_Ireduce(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request)
    The corresponding wrapper function for is the Dist::Comm::ireduce() member function:
    Request ireduce(const void* sendbuf, void* recvbuf, std::size_t count, const Datatype& datatype, const Operation& op, int root) const
    Request ireduce(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op, int root) const
    Nonblocking Reduce.
    Definition: dist.cpp:647
    Communication Request class.
    Definition: dist.hpp:423
    Communication Operation class.
    Definition: dist.hpp:237
    The overloaded wrapper function template with automatic type deduction is:
    template<typename T_>
    Request ireduce(const T_* sendbuf, T_* recvbuf, std::size_t count, const Operation& op, int root) const
Author
Peter Zajac

Definition at line 1348 of file dist.hpp.

Constructor & Destructor Documentation

◆ Comm() [1/3]

FEAT::Dist::Comm::Comm ( )

Standard constructor.

This constructor creates a null communicator representing MPI_COMM_NULL.

Definition at line 372 of file dist.cpp.

Referenced by comm_create_incl(), comm_create_range_incl(), comm_dup(), comm_split(), null(), self(), and world().

◆ Comm() [2/3]

FEAT::Dist::Comm::Comm ( MPI_Comm  comm_)
explicit

MPI_Comm handle constructor

This constructor creates a communicator for a given MPI_Comm handle.

Parameters
[in]comm_The MPI_Comm handle that is to be encapsulated.
Note
This class will automatically free the handle upon destruction by calling MPI_Comm_free() unless comm_ is MPI_COMM_WORLD or MPI_COMM_NULL.

Definition at line 379 of file dist.cpp.

References _rank, _size, and comm.

◆ Comm() [3/3]

FEAT::Dist::Comm::Comm ( Comm &&  other)

Move constructor.

This constructor moves the internal handle of the source communicator and sets the source communicator to a null communicator.

Note
If the source communicator is the world communicator, this constructor will create a copy of the world communicator without modifying other.
Parameters
[in,out]otherThe source communicator that is to be moved.

Definition at line 391 of file dist.cpp.

◆ ~Comm()

FEAT::Dist::Comm::~Comm ( )
virtual

virtual destructor

This destructor frees the internal MPI_Comm handle by calling MPI_Comm_free() unless it is MPI_COMM_WORLD or MPI_COMM_NULL.

Definition at line 422 of file dist.cpp.

References comm.

Member Function Documentation

◆ allgather() [1/2]

template<typename ST_ , typename RT_ >
void FEAT::Dist::Comm::allgather ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount 
) const
inline

Blocking gather-to-all.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe size of the send buffer in datatype objects.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe number of datatype objects received from each process.
See also
[MPI31] Section 5.7, page 165

Definition at line 2321 of file dist.hpp.

References allgather().

◆ allgather() [2/2]

void FEAT::Dist::Comm::allgather ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype 
) const

Blocking gather-to-all.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe size of the send buffer in datatype objects.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe number of datatype objects received from each process.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
See also
[MPI31] Section 5.7, page 165

Definition at line 589 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by FEAT::Geometry::VoxelMap::_compute_voxel_map(), allgather(), FEAT::Global::AlgDofParti< LAFEM::DenseVector< DT_, IT_ >, LAFEM::VectorMirror< DT_, IT_ > >::assemble_allgather(), and FEAT::Geometry::PartiIterative< ConformalMesh< Shape_, num_coords_, Coord_ > >::build_elems_at_rank().

◆ allgatherv() [1/2]

template<typename ST_ , typename RT_ >
void FEAT::Dist::Comm::allgatherv ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
const int *  recvcounts,
const int *  displs 
) const
inline

Blocking gather-to-all.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Attention
In contrast to most other functions, this function uses int rather than std::size_t as the type for the receive counts and displacements for technical reasons!
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe size of the send buffer in datatype objects.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountsA transient array holding the sizes of the receive buffers in datatype objects.
[in]displsA transient array holding the displacements of the receive buffers in datatype objects.
See also
[MPI31] Section 5.7, page 166

Definition at line 2459 of file dist.hpp.

References allgatherv().

◆ allgatherv() [2/2]

void FEAT::Dist::Comm::allgatherv ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
const int *  recvcounts,
const int *  displs,
const Datatype recvtype 
) const

Blocking gather-to-all.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Attention
In contrast to most other functions, this function uses int rather than std::size_t as the type for the receive counts and displacements for technical reasons!
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe size of the send buffer in datatype objects.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountsA transient array holding the sizes of the receive buffers in datatype objects.
[in]displsA transient array holding the displacements of the receive buffers in datatype objects.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
See also
[MPI31] Section 5.7, page 166

Definition at line 607 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by allgatherv().

◆ allprint() [1/2]

void FEAT::Dist::Comm::allprint ( const String msg,
int  root = 0 
) const
inline

Prints the ordered messages of all processes to the standard output stream cout.

Parameters
[in]msgThe message that is to be written to cout. This function automatically appends a new-line after the message (of each rank) and prefixes each output line with the rank of the author process.
[in]rootThe root process that should collect the messages and perform the print.

Definition at line 3138 of file dist.hpp.

References allprint().

◆ allprint() [2/2]

void FEAT::Dist::Comm::allprint ( std::ostream &  os,
const String msg,
int  root = 0 
) const

Prints the ordered messages of all processes to an output stream.

Parameters
[in]osThe output stream to write to. Must be a valid stream on the root process.
[in]msgThe message that is to be written to os. This function automatically appends a new-line after the message (of each rank) and prefixes each output line with the rank of the author process.
[in]rootThe root process that should collect the messages and perform the print.

Definition at line 789 of file dist.cpp.

References _rank, _size, gather(), FEAT::Math::ilog10(), FEAT::String::pad_front(), recv(), send(), FEAT::String::split_by_charset(), FEAT::stringify(), and XASSERTM.

Referenced by allprint().

◆ allreduce() [1/2]

template<typename T_ >
void FEAT::Dist::Comm::allreduce ( const T_ *  sendbuf,
T_ *  recvbuf,
std::size_t  count,
const Operation op 
) const
inline

Blocking All-Reduce.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]opA reference to the Operation object representing the reduction operation.
See also
[MPI31] Section 5.9.6, page 187

Definition at line 2854 of file dist.hpp.

References allreduce().

◆ allreduce() [2/2]

void FEAT::Dist::Comm::allreduce ( const void *  sendbuf,
void *  recvbuf,
std::size_t  count,
const Datatype datatype,
const Operation op 
) const

Blocking All-Reduce.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]opA reference to the Operation object representing the reduction operation.
See also
[MPI31] Section 5.9.6, page 187

Definition at line 655 of file dist.cpp.

References comm, FEAT::Dist::Datatype::dt, and FEAT::Dist::Operation::op.

Referenced by FEAT::Global::MeanFilter< DT_, IT_ >::MeanFilter(), FEAT::Geometry::DistributedUmbrellaSmoother< MeshType_ >::_calc_max(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::_create_multi_layered(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_create_multi_layered(), allreduce(), FEAT::Solver::SchwarzPrecond< Global::Vector< LocalVector_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >::apply(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::asm_adp_symbolic(), FEAT::Global::AlgDofParti< LAFEM::DenseVector< DT_, IT_ >, LAFEM::VectorMirror< DT_, IT_ > >::assemble_by_gate(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::bytes(), FEAT::Control::Meshopt::MeshoptControlBase< DomainControl_ >::compute_mesh_quality(), FEAT::Global::MeanFilter< DT_, IT_ >::filter_rhs(), FEAT::Global::MeanFilter< DT_, IT_ >::filter_sol(), FEAT::MemoryUsage::format_peak_physical_usage(), FEAT::Statistics::get_formatted_solver_internals(), FEAT::Statistics::get_formatted_times(), FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs(), FEAT::Assembly::ScalarDiscreteEvalData< DT_, dim_ >::mean_value_dist(), FEAT::Assembly::VectorDiscreteEvalData< DT_, dim_ >::mean_value_dist(), FEAT::Assembly::MatrixDiscreteEvalData< DT_, dim_i_, dim_j_ >::mean_value_dist(), FEAT::Control::Statistics::report(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::serialize_partitioning(), FEAT::Assembly::TraceAssemblyStokesBodyForceAssemblyJob< VectorVelo_, VectorPres_, SpaceVelo_, SpacePres_ >::sync(), FEAT::Assembly::ScalarErrorInfo< DataType_ >::synchronize(), FEAT::Assembly::VectorErrorInfo< DataType_, dim_ >::synchronize(), FEAT::Assembly::FunctionIntegralInfo< DataType_, ValueType_, GradientType_, HessianType_ >::synchronize(), FEAT::Assembly::VelocityInfo< DataType_, dim_ >::synchronize(), and FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::used_elements().

◆ alltoall() [1/2]

template<typename ST_ , typename RT_ >
void FEAT::Dist::Comm::alltoall ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount 
) const
inline

Blocking All-to-All Scatter/Gather.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe number of datatype objects send to each process.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe number of datatype objects received from each process.
See also
[MPI31] Section 5.8, page 168

Definition at line 2517 of file dist.hpp.

References alltoall().

◆ alltoall() [2/2]

void FEAT::Dist::Comm::alltoall ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype 
) const

Blocking All-to-All Scatter/Gather.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe number of datatype objects send to each process.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe size of the receive buffer in datatype objects.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
See also
[MPI31] Section 5.8, page 168

Definition at line 615 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by alltoall().

◆ alltoallv() [1/2]

template<typename ST_ , typename RT_ >
void FEAT::Dist::Comm::alltoallv ( const ST_ *  sendbuf,
const int *  sendcounts,
const int *  sdispls,
RT_ *  recvbuf,
const int *  recvcounts,
const int *  rdispls 
) const
inline

Blocking All-to-All Scatter/Gather.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Attention
In contrast to most other functions, this function uses int rather than std::size_t as the type for the send/receive counts and displacements for technical reasons!
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountsA transient array holding the number of datatype objects send to each process.
[in]sdisplsA transient array holding the displacements of the send buffers in datatype objects.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountsA transient array holding the number of datatype objects received from each process.
[in]rdisplsA transient array holding the displacements of the receive buffers in datatype objects.
See also
[MPI31] Section 5.8, page 170

Definition at line 2661 of file dist.hpp.

References alltoallv().

◆ alltoallv() [2/2]

void FEAT::Dist::Comm::alltoallv ( const void *  sendbuf,
const int *  sendcounts,
const int *  sdispls,
const Datatype sendtype,
void *  recvbuf,
const int *  recvcounts,
const int *  rdispls,
const Datatype recvtype 
) const

Blocking All-to-All Scatter/Gather.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Attention
In contrast to most other functions, this function uses int rather than std::size_t as the type for the send/receive counts and displacements for technical reasons!
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountsA transient array holding the number of datatype objects send to each process.
[in]sdisplsA transient array holding the displacements of the send buffers in datatype objects.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountsA transient array holding the number of datatype objects received from each process.
[in]rdisplsA transient array holding the displacements of the receive buffers in datatype objects.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
See also
[MPI31] Section 5.8, page 170

Definition at line 633 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by alltoallv().

◆ barrier()

void FEAT::Dist::Comm::barrier ( ) const

Blocking barrier.

See also
[MPI31] Section 5.3, page 147

Definition at line 529 of file dist.cpp.

References comm.

◆ bcast() [1/2]

template<typename T_ >
void FEAT::Dist::Comm::bcast ( T_ *  buffer,
std::size_t  count,
int  root 
) const
inline

Blocking broadcast.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Parameters
[in,out]bufferA transient pointer to the send/receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]rootThe rank of the root process that is sending the broadcast.
See also
[MPI31] Section 5.4, page 148

Definition at line 1936 of file dist.hpp.

References bcast().

◆ bcast() [2/2]

void FEAT::Dist::Comm::bcast ( void *  buffer,
std::size_t  count,
const Datatype datatype,
int  root 
) const

Blocking broadcast.

Parameters
[in,out]bufferA transient pointer to the send/receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]rootThe rank of the root process that is sending the broadcast.
See also
[MPI31] Section 5.4, page 148

Definition at line 541 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by FEAT::Geometry::VoxelMap::_compute_voxel_map(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_deslag_patch_halos(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_split_basemesh_halos(), bcast(), bcast_binarystream(), bcast_stringstream(), FEAT::Geometry::PartiIterative< ConformalMesh< Shape_, num_coords_, Coord_ > >::build_elems_at_rank(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile().

◆ bcast_binarystream()

void FEAT::Dist::Comm::bcast_binarystream ( BinaryStream stream,
int  root = 0 
) const

Blocking broadcast of a BinaryStream.

Parameters
[in,out]streamThe stream that is to be broadcasted.
[in]rootThe rank of the root process that is sending the broadcast.

Definition at line 757 of file dist.cpp.

References bcast(), FEAT::BinaryStream::container(), and rank().

◆ bcast_stringstream()

void FEAT::Dist::Comm::bcast_stringstream ( std::stringstream &  stream,
int  root = 0 
) const

Blocking broadcast of a std::stringstream.

Parameters
[in,out]streamThe stream that is to be broadcasted.
[in]rootThe rank of the root process that is sending the broadcast.

Definition at line 723 of file dist.cpp.

References bcast(), and rank().

◆ comm_create_incl()

Comm FEAT::Dist::Comm::comm_create_incl ( int  n,
const int *  ranks 
) const

Creates a new sub-communicator for a given set of ranks.

This function is a short-cut, which creates a process group by using MPI_Group_incl and then creates a corresponding new communicator via MPI_Comm_create.

See also
[MPI31], Section 6.3.2, page 232
[MPI31], Section 6.4.2, page 240
Parameters
[in]nThe number of desired ranks in the sub-communicator. Must be > 0.
[in]ranksAn transient array of unique ranks that should be part of the new sub-communicator.
Returns
A new sub-communicator for the set of processes. If this process is not part of the new sub-communicator, the returned comm is a null communicator.

Definition at line 498 of file dist.cpp.

References Comm(), comm, and XASSERT.

◆ comm_create_range_incl()

Comm FEAT::Dist::Comm::comm_create_range_incl ( int  count,
int  first = 0,
int  stride = 1 
) const

Creates a new sub-communicator from a strided range of ranks.

This function is a short-cut, which creates a process group by using MPI_Group_range_incl and then creates a corresponding new communicator via MPI_Comm_create.
The ranks, which are contained in the new sub-communicator, are given by first, first+stride, first+2*stride, ..., first+(count-1)*stride.

See also
[MPI31], Section 6.3.2, page 233
[MPI31], Section 6.4.2, page 240
Parameters
[in]countThe number desired ranks in the sub-communicator. Must be > 0.
[in]firstThe rank of the first process to be included in the sub-communicator.
[in]strideThe stride for the rank range. Must be >= 1.
Returns
A new sub-communicator for the range of processes. If this process is not part of the new sub-communicator, the returned comm is a null communicator.

Definition at line 472 of file dist.cpp.

References Comm(), _size, comm, and XASSERT.

Referenced by FEAT::Geometry::VoxelMap::_compute_voxel_map(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_ancestry_scattered(), and FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_multi_layers_scattered().

◆ comm_dup()

◆ comm_split()

Comm FEAT::Dist::Comm::comm_split ( int  color,
int  key 
) const

Creates a new sub-communicator by splitting this communicator.

This functions splits this communicator into disjoint sub-communicators.

Parameters
[in]colorThe color of this process.
[in]keyThe key for the ranking of the process.
See also
[MPI31], Section 6.4.2, page 244
Returns
A new communicator for the set of processes of the same color.

Definition at line 522 of file dist.cpp.

References Comm(), and comm.

◆ exscan() [1/2]

template<typename T_ >
void FEAT::Dist::Comm::exscan ( const T_ *  sendbuf,
T_ *  recvbuf,
std::size_t  count,
const Operation op 
) const
inline

Blocking Exclusive Scan.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]opA reference to the Operation object representing the scan operation.
See also
[MPI31] Section 5.11.2, page 194

Definition at line 3035 of file dist.hpp.

References exscan().

◆ exscan() [2/2]

void FEAT::Dist::Comm::exscan ( const void *  sendbuf,
void *  recvbuf,
std::size_t  count,
const Datatype datatype,
const Operation op 
) const

Blocking Exclusive Scan.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]opA reference to the Operation object representing the scan operation.
See also
[MPI31] Section 5.11.2, page 194

Definition at line 683 of file dist.cpp.

References comm, FEAT::Dist::Datatype::dt, and FEAT::Dist::Operation::op.

Referenced by FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::asm_adp_symbolic(), FEAT::Global::AlgDofParti< LAFEM::DenseVector< DT_, IT_ >, LAFEM::VectorMirror< DT_, IT_ > >::assemble_by_gate(), and exscan().

◆ gather() [1/2]

template<typename ST_ , typename RT_ >
void FEAT::Dist::Comm::gather ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount,
int  root 
) const
inline

Blocking gather.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe size of the send buffer in datatype objects.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe number of datatype objects received from each process.
[in]rootThe rank of the root process that is gathering the data.
See also
[MPI31] Section 5.5, page 149

Definition at line 2055 of file dist.hpp.

References gather().

◆ gather() [2/2]

void FEAT::Dist::Comm::gather ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype,
int  root 
) const

Blocking gather.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe size of the send buffer in datatype objects.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe number of datatype objects received from each process.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
[in]rootThe rank of the root process that is gathering the data.
See also
[MPI31] Section 5.5, page 149

Definition at line 553 of file dist.cpp.

References _rank, comm, and FEAT::Dist::Datatype::dt.

Referenced by FEAT::Geometry::VoxelMap::_compute_voxel_map(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_split_basemesh_halos(), allprint(), gather(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), and FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::serialize_partitioning().

◆ iallgather() [1/2]

template<typename ST_ , typename RT_ >
Request FEAT::Dist::Comm::iallgather ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount 
) const
inline

Nonblocking gather-to-all.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe size of the send buffer in datatype objects.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe number of datatype objects received from each process.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.5, page 204

Definition at line 2387 of file dist.hpp.

References iallgather().

◆ iallgather() [2/2]

Request FEAT::Dist::Comm::iallgather ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype 
) const

Nonblocking gather-to-all.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe size of the send buffer in datatype objects.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe number of datatype objects received from each process.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.5, page 204

Definition at line 597 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by iallgather().

◆ iallreduce() [1/2]

template<typename T_ >
Request FEAT::Dist::Comm::iallreduce ( const T_ *  sendbuf,
T_ *  recvbuf,
std::size_t  count,
const Operation op 
) const
inline

Nonblocking All-Reduce.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send/receive buffer in datatype objects.
[in]opA reference to the Operation object representing the reduction operation.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.8, page 210

Definition at line 2917 of file dist.hpp.

References iallreduce().

◆ iallreduce() [2/2]

Request FEAT::Dist::Comm::iallreduce ( const void *  sendbuf,
void *  recvbuf,
std::size_t  count,
const Datatype datatype,
const Operation op 
) const

Nonblocking All-Reduce.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]opA reference to the Operation object representing the reduction operation.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.8, page 210

Definition at line 660 of file dist.cpp.

References comm, FEAT::Dist::Datatype::dt, and FEAT::Dist::Operation::op.

Referenced by FEAT::Global::SynchScalarTicket< DT_ >::SynchScalarTicket(), and iallreduce().

◆ ialltoall() [1/2]

template<typename ST_ , typename RT_ >
Request FEAT::Dist::Comm::ialltoall ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount 
) const
inline

Nonblocking All-to-All Scatter/Gather.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe number of datatype objects send to each process.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe number of datatype objects received from each process.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.6, page 206

Definition at line 2583 of file dist.hpp.

References ialltoall().

◆ ialltoall() [2/2]

Request FEAT::Dist::Comm::ialltoall ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype 
) const

Nonblocking All-to-All Scatter/Gather.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe number of datatype objects send to each process.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe number of datatype objects received from each process.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.6, page 206

Definition at line 623 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by ialltoall().

◆ ibarrier()

Request FEAT::Dist::Comm::ibarrier ( ) const

Nonblocking barrier.

Returns
A request object for the operation.
See also
[MPI31] Section 5.12.1, page 198

Definition at line 534 of file dist.cpp.

References comm.

◆ ibcast() [1/2]

template<typename T_ >
Request FEAT::Dist::Comm::ibcast ( T_ *  buffer,
std::size_t  count,
int  root 
) const
inline

Nonblocking broadcast.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Parameters
[in,out]bufferA resident pointer to the send/receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send/receive buffer in datatype objects.
[in]rootThe rank of the root process that is sending the broadcast.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.2, page 199

Definition at line 1983 of file dist.hpp.

References ibcast().

◆ ibcast() [2/2]

Request FEAT::Dist::Comm::ibcast ( void *  buffer,
std::size_t  count,
const Datatype datatype,
int  root 
) const

Nonblocking broadcast.

Parameters
[in,out]bufferA resident pointer to the send/receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]rootThe rank of the root process that is sending the broadcast.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.2, page 199

Definition at line 546 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by ibcast().

◆ igather() [1/2]

template<typename ST_ , typename RT_ >
Request FEAT::Dist::Comm::igather ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount,
int  root 
) const
inline

Nonblocking gather.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe size of the send buffer in datatype objects.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe number of datatype objects received from each process.
[in]rootThe rank of the root process that is gathering the data.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.3, page 200

Definition at line 2127 of file dist.hpp.

References igather().

◆ igather() [2/2]

Request FEAT::Dist::Comm::igather ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype,
int  root 
) const

Nonblocking gather.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe size of the send buffer in datatype objects.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe number of datatype objects received from each process.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
[in]rootThe rank of the root process that is gathering the data.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.3, page 200

Definition at line 561 of file dist.cpp.

References _rank, comm, and FEAT::Dist::Datatype::dt.

Referenced by igather().

◆ irecv() [1/2]

template<typename T_ >
Request FEAT::Dist::Comm::irecv ( T_ *  buffer,
std::size_t  count,
int  source,
int  tag = 0 
) const
inline

Nonblocking Receive.

This function automatically deducts the datatype of the receive buffer (if possible).

Parameters
[in]bufferA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the receive buffer in datatype objects.
[in]sourceThe rank of the source process.
[in]tagThe tag for the message.
Returns
A request object for the operation.
See also
[MPI31] Section 3.7.2, page 51

Definition at line 1887 of file dist.hpp.

References irecv().

◆ irecv() [2/2]

Request FEAT::Dist::Comm::irecv ( void *  buffer,
std::size_t  count,
const Datatype datatype,
int  source,
int  tag = 0 
) const

Nonblocking Receive.

Parameters
[in]bufferA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the receive buffer contents.
[in]sourceThe rank of the source process.
[in]tagThe tag for the message.
Returns
A request object for the operation.
See also
[MPI31] Section 3.7.2, page 51

Definition at line 716 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by FEAT::Global::SynchVectorTicket< VT_, VMT_ >::SynchVectorTicket(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_apply(), FEAT::Global::AlgDofPartiMatrix< LocalMatrix_, Mirror_ >::_assemble_buffers(), FEAT::Geometry::DistributedMeshDistortion< MeshType_ >::_calc_shortest_edge(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_deslag_patch_halos(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_split_basemesh_halos(), FEAT::Geometry::GlobalMaskedBoundaryFactory< ParentMesh_ >::_sync_bnd_masks(), FEAT::Geometry::DistributedMeshDistortion< MeshType_ >::_synchronize(), FEAT::Geometry::DistributedUmbrellaSmoother< MeshType_ >::_synchronize(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::asm_adp_symbolic(), FEAT::Global::AlgDofParti< LAFEM::DenseVector< DT_, IT_ >, LAFEM::VectorMirror< DT_, IT_ > >::assemble_by_gate(), FEAT::Global::AlgDofPartiVector< LocalVector_, Mirror_ >::download(), FEAT::Global::SynchMatrix< MT_, VMT_ >::exec(), FEAT::Global::SynchMatrix< MT_, VMT_ >::init(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_numeric(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_symbolic(), irecv(), FEAT::Assembly::StokesFBMAssembler< MeshType_ >::sync(), and FEAT::Global::AlgDofPartiMatrix< LocalMatrix_, Mirror_ >::upload_numeric().

◆ ireduce() [1/2]

template<typename T_ >
Request FEAT::Dist::Comm::ireduce ( const T_ *  sendbuf,
T_ *  recvbuf,
std::size_t  count,
const Operation op,
int  root 
) const
inline

Nonblocking Reduce.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send/receive buffer in datatype objects.
[in]opA reference to the Operation object representing the reduction operation.
[in]rootThe rank of the root process that receives the reduction result.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.7, page 209

Definition at line 2799 of file dist.hpp.

References ireduce().

◆ ireduce() [2/2]

Request FEAT::Dist::Comm::ireduce ( const void *  sendbuf,
void *  recvbuf,
std::size_t  count,
const Datatype datatype,
const Operation op,
int  root 
) const

Nonblocking Reduce.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]opA reference to the Operation object representing the reduction operation.
[in]rootThe rank of the root process that receives the reduction result.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.7, page 209

Definition at line 647 of file dist.cpp.

References _rank, comm, FEAT::Dist::Datatype::dt, and FEAT::Dist::Operation::op.

Referenced by ireduce().

◆ is_null()

bool FEAT::Dist::Comm::is_null ( ) const

Checks whether this communicator is a null communicator.

Returns
true, if this communicator represents MPI_COMM_NULL, otherwise false.

Definition at line 454 of file dist.cpp.

References comm.

Referenced by FEAT::Geometry::VoxelMap::_compute_voxel_map(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_multi_layers_scattered(), and FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_split_basemesh_halos().

◆ is_self()

bool FEAT::Dist::Comm::is_self ( ) const

Checks whether this communicator is the self communicator.

Returns
true, if this communicator represents MPI_COMM_SELF, otherwise false.

Definition at line 449 of file dist.cpp.

References comm.

◆ is_world()

bool FEAT::Dist::Comm::is_world ( ) const

Checks whether this communicator is the world communicator.

Returns
true, if this communicator represents MPI_COMM_WORLD, otherwise false.

Definition at line 444 of file dist.cpp.

References comm.

◆ iscatter() [1/2]

template<typename ST_ , typename RT_ >
Request FEAT::Dist::Comm::iscatter ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount,
int  root 
) const
inline

Nonblocking scatter.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the recvbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe number of datatype objects send to each process.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe size of the receive buffer in datatype objects.
[in]rootThe rank of the root process that is scattering the data.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.4, page 202

Definition at line 2263 of file dist.hpp.

References iscatter().

◆ iscatter() [2/2]

Request FEAT::Dist::Comm::iscatter ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype,
int  root 
) const

Nonblocking scatter.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the recvbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]sendcountThe number of datatype objects send to each process.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA resident pointer to the receive buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]recvcountThe size of the receive buffer in datatype objects.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
[in]rootThe rank of the root process that is scattering the data.
Returns
A request object for the operation.
See also
[MPI31] Section 5.12.4, page 202

Definition at line 579 of file dist.cpp.

References _rank, comm, and FEAT::Dist::Datatype::dt.

Referenced by iscatter().

◆ isend() [1/2]

template<typename T_ >
Request FEAT::Dist::Comm::isend ( const T_ *  buffer,
std::size_t  count,
int  dest,
int  tag = 0 
) const
inline

Nonblocking Send.

This function automatically deducts the datatype of the send buffer (if possible).

Parameters
[in]bufferA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send buffer in datatype objects.
[in]destThe rank of the destination process.
[in]tagThe tag for the message.
Returns
A request object for the operation.
See also
[MPI31] Section 3.7.2, page 49

Definition at line 1834 of file dist.hpp.

References isend().

◆ isend() [2/2]

Request FEAT::Dist::Comm::isend ( const void *  buffer,
std::size_t  count,
const Datatype datatype,
int  dest,
int  tag = 0 
) const

Nonblocking Send.

Parameters
[in]bufferA resident pointer to the send buffer for the operation. The pointer to the buffer is stored internally and must remain valid until the returned request is fulfilled.
[in]countThe size of the send buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send buffer contents.
[in]destThe rank of the destination process.
[in]tagThe tag for the message.
Returns
A request object for the operation.
See also
[MPI31] Section 3.7.2, page 49

Definition at line 704 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by FEAT::Global::SynchVectorTicket< VT_, VMT_ >::SynchVectorTicket(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_apply(), FEAT::Global::AlgDofPartiMatrix< LocalMatrix_, Mirror_ >::_assemble_buffers(), FEAT::Geometry::DistributedMeshDistortion< MeshType_ >::_calc_shortest_edge(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_deslag_patch_halos(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_split_basemesh_halos(), FEAT::Geometry::GlobalMaskedBoundaryFactory< ParentMesh_ >::_sync_bnd_masks(), FEAT::Geometry::DistributedMeshDistortion< MeshType_ >::_synchronize(), FEAT::Geometry::DistributedUmbrellaSmoother< MeshType_ >::_synchronize(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::asm_adp_symbolic(), FEAT::Global::AlgDofParti< LAFEM::DenseVector< DT_, IT_ >, LAFEM::VectorMirror< DT_, IT_ > >::assemble_by_gate(), FEAT::Global::AlgDofPartiVector< LocalVector_, Mirror_ >::download(), FEAT::Global::SynchMatrix< MT_, VMT_ >::exec(), FEAT::Global::SynchMatrix< MT_, VMT_ >::init(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_numeric(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_symbolic(), isend(), FEAT::Assembly::StokesFBMAssembler< MeshType_ >::sync(), and FEAT::Global::AlgDofPartiMatrix< LocalMatrix_, Mirror_ >::upload_numeric().

◆ mpi_comm() [1/2]

MPI_Comm & FEAT::Dist::Comm::mpi_comm ( )
inline
Returns
a reference to the internal MPI_Comm handle

Definition at line 1445 of file dist.hpp.

References comm.

◆ mpi_comm() [2/2]

const MPI_Comm & FEAT::Dist::Comm::mpi_comm ( ) const
inline
Returns
a const reference to the internal MPI_Comm handle

Definition at line 1439 of file dist.hpp.

References comm.

◆ null()

Comm FEAT::Dist::Comm::null ( )
static

Returns a null communicator.

Definition at line 439 of file dist.cpp.

References Comm().

◆ operator=()

Comm & FEAT::Dist::Comm::operator= ( Comm &&  other)

Move-assignment operator.

This operator moves the internal handle of the source communicator and sets the source communicator to a null communicator.

Attention
The destination communicator represented by this must be a null communicator, as this operator will fire an assertion failure otherwise!
Note
If the source communicator is the world communicator, this constructor will create a copy of the world communicator without modifying other.
Parameters
[in,out]otherThe source communicator that is to be moved.

Definition at line 404 of file dist.cpp.

References _rank, _size, comm, and XASSERT.

◆ print() [1/2]

void FEAT::Dist::Comm::print ( const String msg,
int  root = 0 
) const
inline

Prints a message line to the standard output stream cout.

Parameters
[in]msgThe message that is to be written to cout. This function automatically appends a new-line after the message.
[in]rootThe root process that should perform the print.

Definition at line 3106 of file dist.hpp.

References print().

◆ print() [2/2]

void FEAT::Dist::Comm::print ( std::ostream &  os,
const String msg,
int  root = 0 
) const

Prints a message line to an output stream.

Parameters
[in]osThe output stream to write to. Must be a valid stream on the root process.
[in]msgThe message that is to be written to os. This function automatically appends a new-line after the message.
[in]rootThe root process that should perform the print.

Definition at line 782 of file dist.cpp.

References _rank, _size, and XASSERTM.

Referenced by FEAT::Solver::IterativeSolver< Vector_ >::_print_line(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::parse_args(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::parse_property_map(), and print().

◆ print_flush() [1/2]

void FEAT::Dist::Comm::print_flush ( int  root = 0) const
inline

Explicitly flushes cout.

Parameters
[in]rootThe root process that should collect the messages and perform the print.

Definition at line 3160 of file dist.hpp.

References print_flush().

◆ print_flush() [2/2]

void FEAT::Dist::Comm::print_flush ( std::ostream &  os,
int  root = 0 
) const

Explicitly flushes the output stream.

Parameters
[in]osThe output stream to write to. Must be a valid stream on the root process.
[in]rootThe root process that should collect the messages and perform the print.

Definition at line 847 of file dist.cpp.

References _rank, _size, and XASSERTM.

Referenced by print_flush().

◆ rank()

int FEAT::Dist::Comm::rank ( ) const
inline

Returns the rank of this process in this communicator.

Returns
The rank of this process in this communicator.
See also
[MPI31] Section 6.4.1, page 236

Definition at line 1494 of file dist.hpp.

References _rank.

Referenced by FEAT::Geometry::DistributedMeshDistortion< MeshType_ >::_calc_vertex_owners(), FEAT::Geometry::VoxelMap::_compute_voxel_map(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_ancestry_scattered(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_ancestry_single(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::_create_multi_layered(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_multi_layers_scattered(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::_create_single_layered(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_create_single_layered(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_deslag_patch_halos(), FEAT::Geometry::DistributedUmbrellaSmoother< MeshType_ >::_init_edge_multiplicity(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_split_basemesh_halos(), FEAT::Geometry::DistributedMeshDistortion< MeshType_ >::_synchronize(), FEAT::Geometry::DistributedUmbrellaSmoother< MeshType_ >::_synchronize(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::asm_adp_symbolic(), FEAT::Global::AlgDofParti< LAFEM::DenseVector< DT_, IT_ >, LAFEM::VectorMirror< DT_, IT_ > >::assemble_by_gate(), bcast_binarystream(), bcast_stringstream(), FEAT::Geometry::PartiIterative< ConformalMesh< Shape_, num_coords_, Coord_ > >::build_elems_at_rank(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile(), FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs(), FEAT::Runtime::initialize(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_parent(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), FEAT::Control::Statistics::report(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::serialize_partitioning(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv(), FEAT::PropertyMap::write(), and FEAT::Geometry::ExportVTK< Mesh_, cell_dim_ >::write().

◆ recv() [1/4]

template<typename T_ >
void FEAT::Dist::Comm::recv ( T_ *  buffer,
std::size_t  count,
int  source,
int  tag,
Status status 
) const
inline

Blocking Receive.

This function automatically deducts the datatype of the receive buffer (if possible).

Parameters
[in]bufferA transient pointer to the receive buffer for the operation.
[in]countThe size of the receive buffer in datatype objects.
[in]sourceThe rank of the source process.
[in]tagThe tag for the message.
[out]statusA transient reference to the Status object that receives information about the receive operation.
See also
[MPI31] Section 3.2.4, page 28

Definition at line 1746 of file dist.hpp.

References recv().

◆ recv() [2/4]

template<typename T_ >
void FEAT::Dist::Comm::recv ( T_ *  buffer,
std::size_t  count,
int  source,
int  tag = 0 
) const
inline

Blocking Receive.

This function automatically deducts the datatype of the receive buffer (if possible). This function discards the Status object of the receive operation.

Parameters
[in]bufferA transient pointer to the receive buffer for the operation.
[in]countThe size of the receive buffer in datatype objects.
[in]sourceThe rank of the source process.
[in]tagThe tag for the message.
See also
[MPI31] Section 3.2.4, page 28

Definition at line 1772 of file dist.hpp.

References recv().

◆ recv() [3/4]

void FEAT::Dist::Comm::recv ( void *  buffer,
std::size_t  count,
const Datatype datatype,
int  source,
int  tag,
Status status 
) const

Blocking Receive.

Parameters
[in]bufferA transient pointer to the receive buffer for the operation.
[in]countThe size of the receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the receive buffer contents.
[in]sourceThe rank of the source process.
[in]tagThe tag for the message.
[out]statusA transient reference to the Status object that receives information about the receive operation.
See also
[MPI31] Section 3.2.4, page 28

Definition at line 711 of file dist.cpp.

References comm, FEAT::Dist::Datatype::dt, and FEAT::Dist::Status::mpi_status().

Referenced by allprint(), and recv().

◆ recv() [4/4]

void FEAT::Dist::Comm::recv ( void *  buffer,
std::size_t  count,
const Datatype datatype,
int  source,
int  tag = 0 
) const
inline

Blocking Receive.

This function discards the Status object of the receive operation.

Parameters
[in]bufferA transient pointer to the receive buffer for the operation.
[in]countThe size of the receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the receive buffer contents.
[in]sourceThe rank of the source process.
[in]tagThe tag for the message.
See also
[MPI31] Section 3.2.4, page 28

Definition at line 1717 of file dist.hpp.

References recv().

◆ reduce() [1/2]

template<typename T_ >
void FEAT::Dist::Comm::reduce ( const T_ *  sendbuf,
T_ *  recvbuf,
std::size_t  count,
const Operation op,
int  root 
) const
inline

Blocking Reduce.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]opA reference to the Operation object representing the reduction operation.
[in]rootThe rank of the root process that receives the reduction result.
See also
[MPI31] Section 5.9.1, page 174

Definition at line 2730 of file dist.hpp.

References reduce().

◆ reduce() [2/2]

void FEAT::Dist::Comm::reduce ( const void *  sendbuf,
void *  recvbuf,
std::size_t  count,
const Datatype datatype,
const Operation op,
int  root 
) const

Blocking Reduce.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]opA reference to the Operation object representing the reduction operation.
[in]rootThe rank of the root process that receives the reduction result.
See also
[MPI31] Section 5.9.1, page 174

Definition at line 641 of file dist.cpp.

References _rank, comm, FEAT::Dist::Datatype::dt, and FEAT::Dist::Operation::op.

Referenced by reduce().

◆ scan() [1/2]

template<typename T_ >
void FEAT::Dist::Comm::scan ( const T_ *  sendbuf,
T_ *  recvbuf,
std::size_t  count,
const Operation op 
) const
inline

Blocking Inclusive Scan.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]opA reference to the Operation object representing the scan operation.
See also
[MPI31] Section 5.11.1, page 193

Definition at line 2972 of file dist.hpp.

References scan().

◆ scan() [2/2]

void FEAT::Dist::Comm::scan ( const void *  sendbuf,
void *  recvbuf,
std::size_t  count,
const Datatype datatype,
const Operation op 
) const

Blocking Inclusive Scan.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the sendbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient reference to the send buffer for the operation.
[out]recvbufA transient reference to the receive buffer for the operation.
[in]countThe size of the send/receive buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send/receive buffer contents.
[in]opA reference to the Operation object representing the scan operation.
See also
[MPI31] Section 5.11.1, page 193

Definition at line 667 of file dist.cpp.

References comm, FEAT::Dist::Datatype::dt, and FEAT::Dist::Operation::op.

Referenced by scan().

◆ scatter() [1/2]

template<typename ST_ , typename RT_ >
void FEAT::Dist::Comm::scatter ( const ST_ *  sendbuf,
std::size_t  sendcount,
RT_ *  recvbuf,
std::size_t  recvcount,
int  root 
) const
inline

Blocking scatter.

This function automatically deducts the datatype of the send/receive buffer(s) (if possible).

Note
sendbuf and recvbuf are allowed to be identical; in this case, the recvbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe number of datatype objects send to each process.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe size of the receive buffer in datatype objects.
[in]rootThe rank of the root process that is scattering the data.
See also
[MPI31] Section 5.6, page 159

Definition at line 2191 of file dist.hpp.

References scatter().

◆ scatter() [2/2]

void FEAT::Dist::Comm::scatter ( const void *  sendbuf,
std::size_t  sendcount,
const Datatype sendtype,
void *  recvbuf,
std::size_t  recvcount,
const Datatype recvtype,
int  root 
) const

Blocking scatter.

Note
sendbuf and recvbuf are allowed to be identical; in this case, the recvbuf argument of the MPI function call is set to MPI_IN_PLACE.
Parameters
[in]sendbufA transient pointer to the send buffer for the operation.
[in]sendcountThe number of datatype objects send to each process.
[in]sendtypeA reference to the Datatype object representing the send buffer contents.
[out]recvbufA transient pointer to the receive buffer for the operation.
[in]recvcountThe size of the receive buffer in datatype objects.
[in]recvtypeA reference to the Datatype object representing the receive buffer contents.
[in]rootThe rank of the root process that is scattering the data.
See also
[MPI31] Section 5.6, page 159

Definition at line 571 of file dist.cpp.

References _rank, comm, and FEAT::Dist::Datatype::dt.

Referenced by scatter(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv().

◆ self()

Comm FEAT::Dist::Comm::self ( )
static

Returns a copy of the self communicator.

Definition at line 434 of file dist.cpp.

References Comm().

◆ send() [1/2]

template<typename T_ >
void FEAT::Dist::Comm::send ( const T_ *  buffer,
std::size_t  count,
int  dest,
int  tag = 0 
) const
inline

Blocking Send.

This function automatically deducts the datatype of the send buffer (if possible).

Parameters
[in]bufferA transient pointer to the send buffer for the operation.
[in]countThe size of the send buffer in datatype objects.
[in]destThe rank of the destination process.
[in]tagThe tag for the message.
See also
[MPI31] Section 3.2.1, page 24

Definition at line 1665 of file dist.hpp.

References send().

◆ send() [2/2]

void FEAT::Dist::Comm::send ( const void *  buffer,
std::size_t  count,
const Datatype datatype,
int  dest,
int  tag = 0 
) const

Blocking Send.

Parameters
[in]bufferA transient pointer to the send buffer for the operation.
[in]countThe size of the send buffer in datatype objects.
[in]datatypeA reference to the Datatype object representing the send buffer contents.
[in]destThe rank of the destination process.
[in]tagThe tag for the message.
See also
[MPI31] Section 3.2.1, page 24

Definition at line 699 of file dist.cpp.

References comm, and FEAT::Dist::Datatype::dt.

Referenced by allprint(), and send().

◆ size()

int FEAT::Dist::Comm::size ( ) const
inline

Returns the size of this communicator.

Returns
The size of this communicator.
See also
[MPI31] Section 6.4.1, page 235

Definition at line 1506 of file dist.hpp.

References _size.

Referenced by FEAT::Geometry::VoxelMap::_compute_voxel_map(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::_create(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_ancestry_scattered(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_ancestry_single(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::_create_multi_layered(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_create_multi_layered(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_create_multi_layers_scattered(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::_create_single_layered(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::_create_single_layered(), FEAT::Geometry::DistributedUmbrellaSmoother< MeshType_ >::_init_edge_multiplicity(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::_split_basemesh_halos(), FEAT::Geometry::DistributedUmbrellaSmoother< MeshType_ >::_synchronize(), FEAT::Global::AlgDofParti< LAFEM::DenseVector< DT_, IT_ >, LAFEM::VectorMirror< DT_, IT_ > >::assemble_allgather(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::bytes(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_hierarchy(), FEAT::Global::Gate< LocalVector_, Mirror_ >::dot(), FEAT::Global::Gate< LocalVector_, Mirror_ >::get_num_global_dofs(), FEAT::Geometry::PartiParMETIS::get_sub_comm_size(), FEAT::Geometry::PartiZoltan::get_sub_comm_size(), FEAT::Solver::DirectStokesSolver< Global::Matrix< LocalMatrix_, Mirror_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >::init_symbolic(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_child(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_single(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), FEAT::Global::Gate< LocalVector_, Mirror_ >::push(), FEAT::Control::Statistics::report(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::serialize_partitioning(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::set_desired_levels(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv(), FEAT::Assembly::FunctionIntegralInfo< DataType_, ValueType_, GradientType_, HessianType_ >::synchronize(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::used_elements(), and FEAT::Geometry::ExportVTK< Mesh_, cell_dim_ >::write().

◆ world()

Member Data Documentation

◆ _rank

int FEAT::Dist::Comm::_rank
protected

our rank

Definition at line 1358 of file dist.hpp.

Referenced by Comm(), allprint(), gather(), igather(), ireduce(), iscatter(), operator=(), print(), print_flush(), rank(), reduce(), and scatter().

◆ _size

int FEAT::Dist::Comm::_size
protected

the communicator size

Definition at line 1360 of file dist.hpp.

Referenced by Comm(), allprint(), comm_create_range_incl(), operator=(), print(), print_flush(), and size().

◆ comm


The documentation for this class was generated from the following files: