Ginkgo: gko::experimental::mpi::NeighborhoodCommunicator Class Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::experimental::mpi::NeighborhoodCommunicator Class Referencefinal

A CollectiveCommunicator that uses a neighborhood topology. More...

`#include <ginkgo/core/distributed/neighborhood_communicator.hpp>`

Inheritance diagram for gko::experimental::mpi::NeighborhoodCommunicator:
[legend]
Collaboration diagram for gko::experimental::mpi::NeighborhoodCommunicator:
[legend]

## Public Member Functions
| NeighborhoodCommunicator (const NeighborhoodCommunicator &other)=default
| NeighborhoodCommunicator (NeighborhoodCommunicator &&other)
NeighborhoodCommunicator & | operator= (const NeighborhoodCommunicator &other)=default
NeighborhoodCommunicator & | operator= (NeighborhoodCommunicator &&other)
| NeighborhoodCommunicator (communicator base)
| Default constructor with empty communication pattern.
template<typename LocalIndexType, typename GlobalIndexType>
| NeighborhoodCommunicator (communicator base, const distributed::index_map< LocalIndexType, GlobalIndexType > &imap)
| Create a NeighborhoodCommunicator from an index map.
std::unique_ptr< CollectiveCommunicator > | create_with_same_type (communicator base, index_map_ptr imap) const override
| Creates a new CollectiveCommunicator with the same dynamic type.
std::unique_ptr< CollectiveCommunicator > | create_inverse () const override
| Creates the inverse NeighborhoodCommunicator by switching sources and destinations.
comm_index_type | get_recv_size () const override
| Get the number of elements received by this process within this communication pattern.
comm_index_type | get_send_size () const override
| Get the number of elements sent by this process within this communication pattern.
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
| Non-blocking all-to-all communication.
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 communicator & | get_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
| Non-blocking all-to-all communication.
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

## Friends
bool | operator== (const NeighborhoodCommunicator &a, const NeighborhoodCommunicator &b)
| Compares two communicators for equality locally.
bool | operator!= (const NeighborhoodCommunicator &a, const NeighborhoodCommunicator &b)
| Compares two communicators for inequality.

## Additional Inherited Members
Public Types inherited from gko::experimental::mpi::CollectiveCommunicator
using | index_map_ptr
| All allowed index_map types (as const *).

## Detailed Description

A CollectiveCommunicator that uses a neighborhood topology.

The neighborhood communicator is defined by a list of neighbors this rank sends data to and a list of neighbors this rank receives data from. No communication with any ranks that is not in one of those lists will take place.

## Constructor & Destructor Documentation

## ◆ NeighborhoodCommunicator() [1/2]

gko::experimental::mpi::NeighborhoodCommunicator::NeighborhoodCommunicator | ( | communicator | base | ) |
| explicit

Default constructor with empty communication pattern.

Parameters

  base | the base communicator

## ◆ NeighborhoodCommunicator() [2/2]

template<typename LocalIndexType, typename GlobalIndexType>

gko::experimental::mpi::NeighborhoodCommunicator::NeighborhoodCommunicator | ( | communicator | base,
|  | const distributed::index_map< LocalIndexType, GlobalIndexType > & | imap )

Create a NeighborhoodCommunicator 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

  LocalIndexType | the local index type of the map
  GlobalIndexType | the global index type of the map

Parameters

  base | the base communicator
  imap | the index map that defines the communication pattern

## Member Function Documentation

## ◆ create_inverse()

std::unique_ptr< CollectiveCommunicator > gko::experimental::mpi::NeighborhoodCommunicator::create_inverse | ( |  | ) | const
| nodiscardoverridevirtual

Creates the inverse NeighborhoodCommunicator 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::NeighborhoodCommunicator::create_with_same_type | ( | communicator | base,
|  | index_map_ptr | imap ) const
| overridevirtual

Creates a new CollectiveCommunicator with the same dynamic type.

Parameters

  base | The base communicator
  imap | The 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::NeighborhoodCommunicator::get_recv_size | ( |  | ) | const
| nodiscardoverridevirtual

Get the number of elements received by this process within this communication pattern.

Returns
  number of received elements.

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

## ◆ get_send_size()

comm_index_type gko::experimental::mpi::NeighborhoodCommunicator::get_send_size | ( |  | ) | const
| nodiscardoverridevirtual

Get the number of elements sent by this process within this communication pattern.

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
| nodiscard

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

  SendType | the type of the elements to send
  RecvType | the type of the elements to receive

Parameters

  exec | the executor for the communication
  send_buffer | the send buffer
  recv_buffer | the 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

## Friends And Related Symbol Documentation

## ◆ operator!=

bool operator!= | ( | const NeighborhoodCommunicator & | a,
|  | const NeighborhoodCommunicator & | b )
| friend

Compares two communicators for inequality.

See also
  operator==

## ◆ operator==

bool operator== | ( | const NeighborhoodCommunicator & | a,
|  | const NeighborhoodCommunicator & | b )
| friend

Compares two communicators for equality locally.

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:

- ginkgo/core/distributed/neighborhood_communicator.hpp