communicator Class Reference#
|
Reference API
|
#include <ginkgo/core/base/mpi.hpp>
Public Member Functions | |
| communicator (const MPI_Comm &comm, bool force_host_buffer=false) | |
| communicator (const MPI_Comm &comm, int color, int key) | |
| communicator (const communicator &comm, int color, int key) | |
| communicator (const communicator &other)=default | |
| communicator (communicator &&other) | |
| communicator & | operator= (const communicator &other)=default |
| communicator & | operator= (communicator &&other) |
| const MPI_Comm & | get () const |
| bool | force_host_buffer () const |
| int | size () const |
| int | rank () const |
| int | node_local_rank () const |
| bool | operator== (const communicator &rhs) const |
| bool | operator!= (const communicator &rhs) const |
| bool | is_identical (const communicator &rhs) const |
| bool | is_congruent (const communicator &rhs) const |
| void | synchronize () const |
| template<typename SendType > | |
| void | send (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, const int destination_rank, const int send_tag) const |
| template<typename SendType > | |
| request | i_send (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, const int destination_rank, const int send_tag) const |
| template<typename RecvType > | |
| status | recv (std::shared_ptr< const Executor > exec, RecvType *recv_buffer, const int recv_count, const int source_rank, const int recv_tag) const |
| template<typename RecvType > | |
| request | i_recv (std::shared_ptr< const Executor > exec, RecvType *recv_buffer, const int recv_count, const int source_rank, const int recv_tag) const |
| template<typename BroadcastType > | |
| void | broadcast (std::shared_ptr< const Executor > exec, BroadcastType *buffer, int count, int root_rank) const |
| template<typename BroadcastType > | |
| request | i_broadcast (std::shared_ptr< const Executor > exec, BroadcastType *buffer, int count, int root_rank) const |
| template<typename ReduceType > | |
| void | reduce (std::shared_ptr< const Executor > exec, const ReduceType *send_buffer, ReduceType *recv_buffer, int count, MPI_Op operation, int root_rank) const |
| template<typename ReduceType > | |
| request | i_reduce (std::shared_ptr< const Executor > exec, const ReduceType *send_buffer, ReduceType *recv_buffer, int count, MPI_Op operation, int root_rank) const |
| template<typename ReduceType > | |
| void | all_reduce (std::shared_ptr< const Executor > exec, ReduceType *recv_buffer, int count, MPI_Op operation) const |
| template<typename ReduceType > | |
| request | i_all_reduce (std::shared_ptr< const Executor > exec, ReduceType *recv_buffer, int count, MPI_Op operation) const |
| template<typename ReduceType > | |
| void | all_reduce (std::shared_ptr< const Executor > exec, const ReduceType *send_buffer, ReduceType *recv_buffer, int count, MPI_Op operation) const |
| template<typename ReduceType > | |
| request | i_all_reduce (std::shared_ptr< const Executor > exec, const ReduceType *send_buffer, ReduceType *recv_buffer, int count, MPI_Op operation) const |
| template<typename SendType , typename RecvType > | |
| void | gather (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count, int root_rank) const |
| template<typename SendType , typename RecvType > | |
| request | i_gather (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count, int root_rank) const |
| template<typename SendType , typename RecvType > | |
| void | gather_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int *recv_counts, const int *displacements, int root_rank) const |
| template<typename SendType , typename RecvType > | |
| request | i_gather_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int *recv_counts, const int *displacements, int root_rank) const |
| template<typename SendType , typename RecvType > | |
| void | all_gather (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count) const |
| template<typename SendType , typename RecvType > | |
| request | i_all_gather (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count) const |
| template<typename SendType , typename RecvType > | |
| void | scatter (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count, int root_rank) const |
| template<typename SendType , typename RecvType > | |
| request | i_scatter (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count, int root_rank) const |
| template<typename SendType , typename RecvType > | |
| void | scatter_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int *send_counts, const int *displacements, RecvType *recv_buffer, const int recv_count, int root_rank) const |
| template<typename SendType , typename RecvType > | |
| request | i_scatter_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int *send_counts, const int *displacements, RecvType *recv_buffer, const int recv_count, int root_rank) const |
| template<typename RecvType > | |
| void | all_to_all (std::shared_ptr< const Executor > exec, RecvType *recv_buffer, const int recv_count) const |
| template<typename RecvType > | |
| request | i_all_to_all (std::shared_ptr< const Executor > exec, RecvType *recv_buffer, const int recv_count) const |
| template<typename SendType , typename RecvType > | |
| void | all_to_all (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count) const |
| template<typename SendType , typename RecvType > | |
| request | i_all_to_all (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int send_count, RecvType *recv_buffer, const int recv_count) const |
| template<typename SendType , typename RecvType > | |
| void | all_to_all_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int *send_counts, const int *send_offsets, RecvType *recv_buffer, const int *recv_counts, const int *recv_offsets) const |
| void | all_to_all_v (std::shared_ptr< const Executor > exec, const void *send_buffer, const int *send_counts, const int *send_offsets, MPI_Datatype send_type, void *recv_buffer, const int *recv_counts, const int *recv_offsets, MPI_Datatype recv_type) const |
| request | i_all_to_all_v (std::shared_ptr< const Executor > exec, const void *send_buffer, const int *send_counts, const int *send_offsets, MPI_Datatype send_type, void *recv_buffer, const int *recv_counts, const int *recv_offsets, MPI_Datatype recv_type) const |
| template<typename SendType , typename RecvType > | |
| request | i_all_to_all_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, const int *send_counts, const int *send_offsets, RecvType *recv_buffer, const int *recv_counts, const int *recv_offsets) const |
| template<typename ScanType > | |
| void | scan (std::shared_ptr< const Executor > exec, const ScanType *send_buffer, ScanType *recv_buffer, int count, MPI_Op operation) const |
| template<typename ScanType > | |
| request | i_scan (std::shared_ptr< const Executor > exec, const ScanType *send_buffer, ScanType *recv_buffer, int count, MPI_Op operation) const |
Static Public Member Functions | |
| static communicator | create_owning (const MPI_Comm &comm, bool force_host_buffer=false) |
Detailed Description
A thin wrapper of MPI_Comm that supports most MPI calls.
A wrapper class that takes in the given MPI communicator. If a bare MPI_Comm is provided, the wrapper takes no ownership of the MPI_Comm. Thus the MPI_Comm must remain valid throughout the lifetime of the communicator. If the communicator was created through splitting, the wrapper takes ownership of the MPI_Comm. In this case, as the class or object goes out of scope, the underlying MPI_Comm is freed.
- Note
- All MPI calls that work on a buffer take in an Executor as an additional argument. This argument specifies the memory space the buffer lives in.
Constructor & Destructor Documentation
◆ communicator() [1/5]
|
inline |
Non-owning constructor for an existing communicator of type MPI_Comm. The MPI_Comm object will not be deleted after the communicator object has been freed and an explicit MPI_Comm_free needs to be called on the original MPI_Comm object.
- Parameters
-
comm The input MPI_Comm object. force_host_buffer If set to true, always communicates through host memory
◆ communicator() [2/5]
|
inline |
Create a communicator object from an existing MPI_Comm object using color and key.
- Parameters
-
comm The input MPI_Comm object. color The color to split the original comm object key The key to split the comm object
◆ communicator() [3/5]
|
inline |
Create a communicator object from an existing MPI_Comm object using color and key.
- Parameters
-
comm The input communicator object. color The color to split the original comm object key The key to split the comm object
References get().
◆ communicator() [4/5]
|
default |
Create a copy of a communicator.
Potential ownership of the underlying MPI_Comm will be shared.
◆ communicator() [5/5]
|
inline |
Move constructor.
The other communicator will relinquish any potential ownership and use MPI_COMM_NULL as underlying MPI_Comm after the move operation.
Member Function Documentation
◆ all_gather()
|
inline |
Gather data onto all ranks from all ranks in the communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
References get().
◆ all_reduce() [1/2]
|
inline |
Reduce data from all calling processes from all calling processes on same communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the data to reduce recv_buffer the reduced result count the number of elements to reduce operation the reduce operation. See @MPI_Op
- Template Parameters
-
ReduceType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
References get().
◆ all_reduce() [2/2]
|
inline |
(In-place) Reduce data from all calling processes from all calling processes on same communicator.
- Parameters
-
exec The executor, on which the message buffer is located. recv_buffer the data to reduce and the reduced result count the number of elements to reduce operation the MPI_Op type reduce operation.
- Template Parameters
-
ReduceType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
References get().
◆ all_to_all() [1/2]
|
inline |
Communicate data from all ranks to all other ranks (MPI_Alltoall). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to send send_count the number of elements to send recv_buffer the buffer to receive recv_count the number of elements to receive
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
References get().
◆ all_to_all() [2/2]
|
inline |
(In-place) Communicate data from all ranks to all other ranks in place (MPI_Alltoall). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffer is located. buffer the buffer to send and the buffer receive recv_count the number of elements to receive comm the communicator
- Template Parameters
-
RecvType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Note
- This overload uses MPI_IN_PLACE and the source and destination buffers are the same.
References get().
◆ all_to_all_v() [1/2]
|
inline |
Communicate data from all ranks to all other ranks with offsets (MPI_Alltoallv). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to send send_count the number of elements to send send_offsets the offsets for the send buffer recv_buffer the buffer to gather into recv_count the number of elements to receive recv_offsets the offsets for the recv buffer comm the communicator
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
References all_to_all_v().
Referenced by all_to_all_v().
◆ all_to_all_v() [2/2]
|
inline |
Communicate data from all ranks to all other ranks with offsets (MPI_Alltoallv). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to send send_count the number of elements to send send_offsets the offsets for the send buffer send_type the MPI_Datatype for the send buffer recv_buffer the buffer to gather into recv_count the number of elements to receive recv_offsets the offsets for the recv buffer recv_type the MPI_Datatype for the recv buffer comm the communicator
References get().
◆ broadcast()
|
inline |
Broadcast data from calling process to all ranks in the communicator
- Parameters
-
exec The executor, on which the message buffer is located. buffer the buffer to broadcast count the number of elements to broadcast root_rank the rank to broadcast from
- Template Parameters
-
BroadcastType the type of the data to broadcast. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
References get().
◆ create_owning()
|
inlinestatic |
Creates a new communicator and takes ownership of the MPI_Comm.
The ownership is shared with all mpi::communicator objects that are a copy from the newly created communicator. The underlying MPI_Comm will be freed when the last communicator with ownership is destroyed.
◆ gather()
|
inline |
Gather data onto the root rank from all ranks in the communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive root_rank the rank to gather into
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
References get().
◆ gather_v()
|
inline |
Gather data onto the root rank from all ranks in the communicator with offsets.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive displacements the offsets for the buffer root_rank the rank to gather into
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
References get().
◆ get()
|
inline |
Return the underlying MPI_Comm object.
- Returns
- the MPI_Comm object
Referenced by all_gather(), all_reduce(), all_reduce(), all_to_all(), all_to_all(), all_to_all_v(), broadcast(), communicator(), gather(), gather_v(), i_all_gather(), i_all_reduce(), i_all_reduce(), i_all_to_all(), i_all_to_all(), i_all_to_all_v(), i_broadcast(), i_gather(), i_gather_v(), i_recv(), i_reduce(), i_scan(), i_scatter(), i_scatter_v(), i_send(), is_congruent(), is_identical(), recv(), reduce(), scan(), scatter(), scatter_v(), send(), synchronize(), and gko::experimental::mpi::window< ValueType >::window().
◆ i_all_gather()
|
inline |
(Non-blocking) Gather data onto all ranks from all ranks in the communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_all_reduce() [1/2]
|
inline |
Reduce data from all calling processes from all calling processes on same communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the data to reduce recv_buffer the reduced result count the number of elements to reduce operation the reduce operation. See @MPI_Op
- Template Parameters
-
ReduceType the type of the data to reduce. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_all_reduce() [2/2]
|
inline |
(In-place, non-blocking) Reduce data from all calling processes from all calling processes on same communicator.
- Parameters
-
exec The executor, on which the message buffer is located. recv_buffer the data to reduce and the reduced result count the number of elements to reduce operation the reduce operation. See @MPI_Op
- Template Parameters
-
ReduceType the type of the data to reduce. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_all_to_all() [1/2]
|
inline |
(Non-blocking) Communicate data from all ranks to all other ranks (MPI_Ialltoall). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to send send_count the number of elements to send recv_buffer the buffer to receive recv_count the number of elements to receive
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_all_to_all() [2/2]
|
inline |
(In-place, Non-blocking) Communicate data from all ranks to all other ranks in place (MPI_Ialltoall). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffer is located. buffer the buffer to send and the buffer receive recv_count the number of elements to receive comm the communicator
- Template Parameters
-
RecvType the type of the data to receive. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the call
- Note
- This overload uses MPI_IN_PLACE and the source and destination buffers are the same.
References gko::experimental::mpi::request::get(), and get().
◆ i_all_to_all_v() [1/2]
|
inline |
Communicate data from all ranks to all other ranks with offsets (MPI_Ialltoallv). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to send send_count the number of elements to send send_offsets the offsets for the send buffer recv_buffer the buffer to gather into recv_count the number of elements to receive recv_offsets the offsets for the recv buffer
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
- Returns
- the request handle for the call
References i_all_to_all_v().
◆ i_all_to_all_v() [2/2]
|
inline |
Communicate data from all ranks to all other ranks with offsets (MPI_Ialltoallv). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to send send_count the number of elements to send send_offsets the offsets for the send buffer send_type the MPI_Datatype for the send buffer recv_buffer the buffer to gather into recv_count the number of elements to receive recv_offsets the offsets for the recv buffer recv_type the MPI_Datatype for the recv buffer
- Returns
- the request handle for the call
- Note
- This overload allows specifying the MPI_Datatype for both the send and received data.
References gko::experimental::mpi::request::get(), and get().
Referenced by i_all_to_all_v().
◆ i_broadcast()
|
inline |
(Non-blocking) Broadcast data from calling process to all ranks in the communicator
- Parameters
-
exec The executor, on which the message buffer is located. buffer the buffer to broadcast count the number of elements to broadcast root_rank the rank to broadcast from
- Template Parameters
-
BroadcastType the type of the data to broadcast. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_gather()
|
inline |
(Non-blocking) Gather data onto the root rank from all ranks in the communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive root_rank the rank to gather into
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_gather_v()
|
inline |
(Non-blocking) Gather data onto the root rank from all ranks in the communicator with offsets.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive displacements the offsets for the buffer root_rank the rank to gather into
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_recv()
|
inline |
Receive (Non-blocking, Immediate return) data from source rank.
- Parameters
-
exec The executor, on which the message buffer is located. recv_buffer the buffer to send recv_count the number of elements to receive source_rank the rank to receive the data from recv_tag the tag for the recv call
- Template Parameters
-
RecvType the type of the data to receive. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the recv call
References gko::experimental::mpi::request::get(), and get().
◆ i_reduce()
|
inline |
(Non-blocking) Reduce data into root from all calling processes on the same communicator.
- Parameters
-
exec The executor, on which the message buffer is located. send_buffer the buffer to reduce recv_buffer the reduced result count the number of elements to reduce operation the MPI_Op type reduce operation.
- Template Parameters
-
ReduceType the type of the data to reduce. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_scan()
|
inline |
Does a scan operation with the given operator. (MPI_Iscan). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to scan from recv_buffer the result buffer recv_count the number of elements to scan operation the operation type to be used for the scan. See @MPI_Op
- Template Parameters
-
ScanType the type of the data to scan. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_scatter()
|
inline |
(Non-blocking) Scatter data from root rank to all ranks in the communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_scatter_v()
|
inline |
(Non-blocking) Scatter data from root rank to all ranks in the communicator with offsets.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive displacements the offsets for the buffer comm the communicator
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
- Returns
- the request handle for the call
References gko::experimental::mpi::request::get(), and get().
◆ i_send()
|
inline |
Send (Non-blocking, Immediate return) data from calling process to destination rank.
- Parameters
-
exec The executor, on which the message buffer is located. send_buffer the buffer to send send_count the number of elements to send destination_rank the rank to send the data to send_tag the tag for the send call
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the request handle for the send call
References gko::experimental::mpi::request::get(), and get().
◆ is_congruent()
|
inline |
Checks if the rhs communicator is congruent to this communicator.
Congruent communicators are defined as having identical rank members and rank ordering.
- Note
- If MPI_COMM_NULL is the underlying MPI_COMM of this, then the communicator is congruent to rhs, iff MPI_COMM_NULL is also the underlying MPI_COMM of rhs.
- Returns
- true if rhs is congruent to this
References get().
◆ is_identical()
|
inline |
Checks if the rhs communicator is identical to this communicator.
- Note
- If MPI_COMM_NULL is the underlying MPI_COMM of this, then the communicator is equal to rhs, iff MPI_COMM_NULL is also the underlying MPI_COMM of rhs.
- Returns
- true if rhs is identical to this
References get().
Referenced by operator==().
◆ node_local_rank()
|
inline |
Return the node local rank of the calling process in the communicator.
- Returns
- the node local rank
◆ operator!=()
|
inline |
Compare two communicator objects for non-equality.
- Returns
- if the two comm objects are not equal
◆ operator=() [1/2]
|
inline |
- See also
- communicator(communicator&&)
◆ operator=() [2/2]
|
default |
◆ operator==()
|
inline |
Compare two communicator objects for equality.
- Returns
- if the two comm objects are equal
References is_identical().
◆ rank()
|
inline |
Return the rank of the calling process in the communicator.
- Returns
- the rank
◆ recv()
|
inline |
Receive data from source rank.
- Parameters
-
exec The executor, on which the message buffer is located. recv_buffer the buffer to receive recv_count the number of elements to receive source_rank the rank to receive the data from recv_tag the tag for the recv call
- Template Parameters
-
RecvType the type of the data to receive. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
- Returns
- the status of completion of this call
References gko::experimental::mpi::status::get(), and get().
◆ reduce()
|
inline |
Reduce data into root from all calling processes on the same communicator.
- Parameters
-
exec The executor, on which the message buffer is located. send_buffer the buffer to reduce recv_buffer the reduced result count the number of elements to reduce operation the MPI_Op type reduce operation.
- Template Parameters
-
ReduceType the type of the data to reduce. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
References get().
◆ scan()
|
inline |
Does a scan operation with the given operator. (MPI_Scan). See MPI documentation for more details.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to scan from recv_buffer the result buffer recv_count the number of elements to scan operation the operation type to be used for the scan. See @MPI_Op
- Template Parameters
-
ScanType the type of the data to scan. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
References get().
◆ scatter()
|
inline |
Scatter data from root rank to all ranks in the communicator.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
References get().
◆ scatter_v()
|
inline |
Scatter data from root rank to all ranks in the communicator with offsets.
- Parameters
-
exec The executor, on which the message buffers are located. send_buffer the buffer to gather from send_count the number of elements to send recv_buffer the buffer to gather into recv_count the number of elements to receive displacements the offsets for the buffer comm the communicator
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype. RecvType the type of the data to receive. The same restrictions as for SendType apply.
References get().
◆ send()
|
inline |
Send (Blocking) data from calling process to destination rank.
- Parameters
-
exec The executor, on which the message buffer is located. send_buffer the buffer to send send_count the number of elements to send destination_rank the rank to send the data to send_tag the tag for the send call
- Template Parameters
-
SendType the type of the data to send. Has to be a type which has a specialization of type_impl that defines its MPI_Datatype.
References get().
◆ size()
|
inline |
Return the size of the communicator (number of ranks).
- Returns
- the size
◆ synchronize()
|
inline |
This function is used to synchronize the ranks in the communicator. Calls MPI_Barrier
References get().
The documentation for this class was generated from the following file:
- ginkgo/core/base/mpi.hpp
Generated by