Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::MessagePassing::GatherMessageInfo< DataType > Class Template Reference

Brief information for a 'gather' message for data type DataType. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/message_passing/arccore/message_passing/GatherMessageInfo.h>

Inheritance diagram for Arcane::MessagePassing::GatherMessageInfo< DataType >:
Collaboration diagram for Arcane::MessagePassing::GatherMessageInfo< DataType >:

Public Types

using BaseClass = GatherMessageInfoBase
Public Types inherited from Arcane::MessagePassing::GatherMessageInfoBase
enum class  Mode { Gather , GatherVariable , GatherVariableNeedComputeInfo , Null }
 Message mode. More...

Public Member Functions

 GatherMessageInfo ()=default
 Message for everyone and blocking.
 GatherMessageInfo (MessageRank dest_rank)
 Blocking message having destination rank.
 GatherMessageInfo (MessageRank dest_rank, eBlockingType blocking_type)
 Message having destination dest_rank and blocking mode blocking_type.
void setGather (Span< const DataType > send_buf, Span< DataType > receive_buf)
 Brief message equivalent to MPI_Gather or MPI_Allgather.
void setGatherVariable (Span< const DataType > send_buf, Array< DataType > *receive_array)
 Brief message equivalent to MPI_Gatherv or MPI_Allgatherv.
void setGatherVariable (Span< const DataType > send_buf, Span< DataType > receive_buf, Span< const Int32 > receive_counts, Span< const Int32 > receive_displacements)
 Brief message equivalent to MPI_Gatherv or MPI_Allgatherv.
Array< DataType > * localReceptionBuffer () const
 Receive buffer for the T_GatherVariableNeedComputeInfo type.
Span< const DataType > sendBuffer () const
 Send buffer. It is used in all modes.
Span< DataType > receiveBuffer () const
 Receive buffer. Used in Gather and GatherVariable mode by ranks that receive.
Span< const Int32receiveDisplacement ()
 Displacement array. Used in GatherVariable mode.
Span< const Int32receiveCounts () const
 Counts array. Used in GatherVariable mode.
Public Member Functions inherited from Arcane::MessagePassing::GatherMessageInfoBase
 GatherMessageInfoBase ()=default
 Message for everyone and blocking.
 GatherMessageInfoBase (MessageRank dest_rank)
 Blocking message having destination rank.
 GatherMessageInfoBase (MessageRank dest_rank, eBlockingType blocking_type)
 Message having destination dest_rank and blocking mode blocking_type.
void setBlocking (bool is_blocking)
bool isBlocking () const
 Indicates if the message is blocking.
MessageRank destinationRank () const
 Rank of the message destination.
void setDestinationRank (MessageRank rank)
 Sets the rank of the message destination.
Mode mode () const
 Message mode.
void print (std::ostream &o) const
 Prints the message.
bool isValid () const

Private Attributes

Array< DataType > * m_local_reception_buffer = nullptr
Span< const DataType > m_send_buffer
Span< DataType > m_receive_buf
Span< const Int32m_receive_displacements
Span< const Int32m_receive_counts

Additional Inherited Members

Protected Member Functions inherited from Arcane::MessagePassing::GatherMessageInfoBase
void _setType (Mode t)

Detailed Description

template<typename DataType>
class Arcane::MessagePassing::GatherMessageInfo< DataType >

Brief information for a 'gather' message for data type DataType.

One of the setGather() or setGatherVariable() methods must be called before sending the corresponding message. The instances passed as arguments to these two methods must remain alive until the message is complete.

Definition at line 131 of file GatherMessageInfo.h.

Member Typedef Documentation

◆ BaseClass

template<typename DataType>
using Arcane::MessagePassing::GatherMessageInfo< DataType >::BaseClass = GatherMessageInfoBase

Definition at line 136 of file GatherMessageInfo.h.

Constructor & Destructor Documentation

◆ GatherMessageInfo() [1/2]

template<typename DataType>
Arcane::MessagePassing::GatherMessageInfo< DataType >::GatherMessageInfo ( MessageRank dest_rank)
inlineexplicit

Blocking message having destination rank.

Definition at line 144 of file GatherMessageInfo.h.

◆ GatherMessageInfo() [2/2]

template<typename DataType>
Arcane::MessagePassing::GatherMessageInfo< DataType >::GatherMessageInfo ( MessageRank dest_rank,
eBlockingType blocking_type )
inline

Message having destination dest_rank and blocking mode blocking_type.

Definition at line 149 of file GatherMessageInfo.h.

Member Function Documentation

◆ localReceptionBuffer()

template<typename DataType>
Array< DataType > * Arcane::MessagePassing::GatherMessageInfo< DataType >::localReceptionBuffer ( ) const
inline

Receive buffer for the T_GatherVariableNeedComputeInfo type.

May be null for ranks not involved in reception.

Definition at line 214 of file GatherMessageInfo.h.

◆ receiveBuffer()

template<typename DataType>
Span< DataType > Arcane::MessagePassing::GatherMessageInfo< DataType >::receiveBuffer ( ) const
inline

Receive buffer. Used in Gather and GatherVariable mode by ranks that receive.

Definition at line 220 of file GatherMessageInfo.h.

◆ receiveCounts()

template<typename DataType>
Span< const Int32 > Arcane::MessagePassing::GatherMessageInfo< DataType >::receiveCounts ( ) const
inline

Counts array. Used in GatherVariable mode.

Definition at line 226 of file GatherMessageInfo.h.

◆ receiveDisplacement()

template<typename DataType>
Span< const Int32 > Arcane::MessagePassing::GatherMessageInfo< DataType >::receiveDisplacement ( )
inline

Displacement array. Used in GatherVariable mode.

Definition at line 223 of file GatherMessageInfo.h.

◆ sendBuffer()

template<typename DataType>
Span< const DataType > Arcane::MessagePassing::GatherMessageInfo< DataType >::sendBuffer ( ) const
inline

Send buffer. It is used in all modes.

Definition at line 217 of file GatherMessageInfo.h.

◆ setGather()

template<typename DataType>
void Arcane::MessagePassing::GatherMessageInfo< DataType >::setGather ( Span< const DataType > send_buf,
Span< DataType > receive_buf )
inline

Brief message equivalent to MPI_Gather or MPI_Allgather.

All ranks must provide a valid value for send_buf. Only the destination rank must provide receive_buf. receive_buf must be able to accommodate the size send_buf.size() * nb_rank.

Definition at line 162 of file GatherMessageInfo.h.

◆ setGatherVariable() [1/2]

template<typename DataType>
void Arcane::MessagePassing::GatherMessageInfo< DataType >::setGatherVariable ( Span< const DataType > send_buf,
Array< DataType > * receive_array )
inline

Brief message equivalent to MPI_Gatherv or MPI_Allgatherv.

This prototype is used when it is unknown what each rank will send. If this information is known, it is preferable to use the setGatherVariable() method containing the displacements and message size of each participant.

Calling this method triggers a call to mpGather() to determine what each participant must send. For this reason, it cannot be used in blocking mode.

Only the destination rank must provide receive_array. For others, it is possible to use nullptr.

Definition at line 184 of file GatherMessageInfo.h.

◆ setGatherVariable() [2/2]

template<typename DataType>
void Arcane::MessagePassing::GatherMessageInfo< DataType >::setGatherVariable ( Span< const DataType > send_buf,
Span< DataType > receive_buf,
Span< const Int32 > receive_counts,
Span< const Int32 > receive_displacements )
inline

Brief message equivalent to MPI_Gatherv or MPI_Allgatherv.

All ranks must provide a valid value for send_buf, receive_counts and receive_displacements. Only the destination rank must provide receive_buf. receive_buf must be able to accommodate the size send_buf.size() * nb_rank.

Definition at line 199 of file GatherMessageInfo.h.

Member Data Documentation

◆ m_local_reception_buffer

template<typename DataType>
Array<DataType>* Arcane::MessagePassing::GatherMessageInfo< DataType >::m_local_reception_buffer = nullptr
private

Definition at line 230 of file GatherMessageInfo.h.

◆ m_receive_buf

template<typename DataType>
Span<DataType> Arcane::MessagePassing::GatherMessageInfo< DataType >::m_receive_buf
private

Definition at line 232 of file GatherMessageInfo.h.

◆ m_receive_counts

template<typename DataType>
Span<const Int32> Arcane::MessagePassing::GatherMessageInfo< DataType >::m_receive_counts
private

Definition at line 234 of file GatherMessageInfo.h.

◆ m_receive_displacements

template<typename DataType>
Span<const Int32> Arcane::MessagePassing::GatherMessageInfo< DataType >::m_receive_displacements
private

Definition at line 233 of file GatherMessageInfo.h.

◆ m_send_buffer

template<typename DataType>
Span<const DataType> Arcane::MessagePassing::GatherMessageInfo< DataType >::m_send_buffer
private

Definition at line 231 of file GatherMessageInfo.h.


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