DenseCommunicator Class Reference

DenseCommunicator Class Reference#

Reference API: gko::experimental::mpi::DenseCommunicator Class Reference
Reference API
gko::experimental::mpi::DenseCommunicator Class Referencefinal

#include <ginkgo/core/distributed/dense_communicator.hpp>

Inheritance diagram for gko::experimental::mpi::DenseCommunicator:
[legend]

Public Member Functions

 DenseCommunicator (const DenseCommunicator &other)=default
 
 DenseCommunicator (DenseCommunicator &&other)
 
DenseCommunicatoroperator= (const DenseCommunicator &other)=default
 
DenseCommunicatoroperator= (DenseCommunicator &&other)
 
 DenseCommunicator (communicator base)
 
template<typename LocalIndexType , typename GlobalIndexType >
 DenseCommunicator (communicator base, const distributed::index_map< LocalIndexType, GlobalIndexType > &imap)
 
std::unique_ptr< CollectiveCommunicatorcreate_with_same_type (communicator base, const distributed::index_map_variant &imap) const override
 
std::unique_ptr< CollectiveCommunicatorcreate_inverse () const override
 
comm_index_type get_recv_size () const override
 
comm_index_type get_send_size () const override
 
template<typename SendType , typename RecvType >
request i_all_to_all_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, RecvType *recv_buffer) const
 
request i_all_to_all_v (std::shared_ptr< const Executor > exec, const void *send_buffer, MPI_Datatype send_type, void *recv_buffer, MPI_Datatype recv_type) const
 
- Public Member Functions inherited from gko::experimental::mpi::CollectiveCommunicator
 CollectiveCommunicator (communicator base=MPI_COMM_NULL)
 
const communicatorget_base_communicator () const
 
template<typename SendType , typename RecvType >
request i_all_to_all_v (std::shared_ptr< const Executor > exec, const SendType *send_buffer, RecvType *recv_buffer) const
 
request i_all_to_all_v (std::shared_ptr< const Executor > exec, const void *send_buffer, MPI_Datatype send_type, void *recv_buffer, MPI_Datatype recv_type) const
 

Protected Member Functions

request i_all_to_all_v_impl (std::shared_ptr< const Executor > exec, const void *send_buffer, MPI_Datatype send_type, void *recv_buffer, MPI_Datatype recv_type) const override
 

Friends

bool operator== (const DenseCommunicator &a, const DenseCommunicator &b)
 
bool operator!= (const DenseCommunicator &a, const DenseCommunicator &b)
 

Detailed Description

A CollectiveCommunicator that uses a dense communication.

The dense communicator uses the MPI_Alltoall function for its communication.

Constructor & Destructor Documentation

◆ DenseCommunicator() [1/2]

gko::experimental::mpi::DenseCommunicator::DenseCommunicator ( communicator  base)
explicit

Default constructor with empty communication pattern

Parameters
basethe base communicator

◆ DenseCommunicator() [2/2]

template<typename LocalIndexType , typename GlobalIndexType >
gko::experimental::mpi::DenseCommunicator::DenseCommunicator ( communicator  base,
const distributed::index_map< LocalIndexType, GlobalIndexType > &  imap 
)

Create a DenseCommunicator from an index map.

The receiving neighbors are defined by the remote indices and their owning ranks of the index map. The send neighbors are deduced from that through collective communication.

Template Parameters
LocalIndexTypethe local index type of the map
GlobalIndexTypethe global index type of the map
Parameters
basethe base communicator
imapthe index map that defines the communication pattern

Member Function Documentation

◆ create_inverse()

std::unique_ptr< CollectiveCommunicator > gko::experimental::mpi::DenseCommunicator::create_inverse ( ) const
overridevirtual

Creates the inverse DenseCommunicator by switching sources and destinations.

Returns
CollectiveCommunicator with the inverse communication pattern

Implements gko::experimental::mpi::CollectiveCommunicator.

◆ create_with_same_type()

std::unique_ptr< CollectiveCommunicator > gko::experimental::mpi::DenseCommunicator::create_with_same_type ( communicator  base,
const distributed::index_map_variant &  imap 
) const
overridevirtual

Creates a new CollectiveCommunicator with the same dynamic type.

Parameters
baseThe base communicator
imapThe index_map that defines the communication pattern
Returns
a CollectiveCommunicator with the same dynamic type

Implements gko::experimental::mpi::CollectiveCommunicator.

◆ get_recv_size()

comm_index_type gko::experimental::mpi::DenseCommunicator::get_recv_size ( ) const
overridevirtual

Get the total number of received elements this communication patterns expects.

Returns
number of received elements.

Implements gko::experimental::mpi::CollectiveCommunicator.

◆ get_send_size()

comm_index_type gko::experimental::mpi::DenseCommunicator::get_send_size ( ) const
overridevirtual

Get the total number of sent elements this communication patterns expects.

Returns
number of sent elements.

Implements gko::experimental::mpi::CollectiveCommunicator.

◆ i_all_to_all_v() [1/2]

template<typename SendType , typename RecvType >
request gko::experimental::mpi::CollectiveCommunicator::i_all_to_all_v ( std::shared_ptr< const Executor exec,
const SendType *  send_buffer,
RecvType *  recv_buffer 
) const

Non-blocking all-to-all communication.

The send_buffer must have allocated at least get_send_size number of elements, and the recv_buffer must have allocated at least get_recv_size number of elements.

Template Parameters
SendTypethe type of the elements to send
RecvTypethe type of the elements to receive
Parameters
execthe executor for the communication
send_bufferthe send buffer
recv_bufferthe receive buffer
Returns
a request handle

◆ i_all_to_all_v() [2/2]

request gko::experimental::mpi::CollectiveCommunicator::i_all_to_all_v ( std::shared_ptr< const Executor exec,
const void *  send_buffer,
MPI_Datatype  send_type,
void *  recv_buffer,
MPI_Datatype  recv_type 
) const

◆ i_all_to_all_v_impl()

request gko::experimental::mpi::DenseCommunicator::i_all_to_all_v_impl ( std::shared_ptr< const Executor exec,
const void *  send_buffer,
MPI_Datatype  send_type,
void *  recv_buffer,
MPI_Datatype  recv_type 
) const
overrideprotectedvirtual

Non-blocking all-to-all communication.

The send_buffer must have allocated at least get_send_size number of elements, and the recv_buffer must have allocated at least get_recv_size number of elements.

Template Parameters
SendTypethe type of the elements to send
RecvTypethe type of the elements to receive
Parameters
execthe executor for the communication
send_bufferthe send buffer
recv_bufferthe receive buffer
Returns
a request handle

This implementation uses the dense communication MPI_Alltoallv. See MPI documentation for more details.

Implements gko::experimental::mpi::CollectiveCommunicator.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const DenseCommunicator a,
const DenseCommunicator b 
)
friend

Compares two communicators for inequality.

See also
operator==

◆ operator==

bool operator== ( const DenseCommunicator a,
const DenseCommunicator b 
)
friend

Compares two communicators for equality.

Equality is defined as having identical or congruent communicators and their communication pattern is equal. No communication is done, i.e. there is no reduction over the local equality check results.

Returns
true if both communicators are equal.

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