12#ifndef ARCCORE_MESSAGEPASSING_GATHERMESSAGEINFO_H
13#define ARCCORE_MESSAGEPASSING_GATHERMESSAGEINFO_H
17#include "arccore/collections/Array.h"
18#include "arccore/message_passing/MessageRank.h"
45 GatherVariableNeedComputeInfo,
56 : m_destination_rank(dest_rank)
61 : m_destination_rank(dest_rank)
62 , m_is_blocking(blocking_type == Blocking)
67 void setBlocking(
bool is_blocking)
69 m_is_blocking = is_blocking;
80 m_destination_rank = rank;
87 void print(std::ostream& o)
const;
101 if (m_mode == Mode::Null)
108 void _setType(Mode t)
115 MessageRank m_destination_rank;
116 bool m_is_blocking =
true;
117 Mode m_mode = Mode::Null;
130template <
typename DataType>
145 : BaseClass(dest_rank)
150 : BaseClass(dest_rank, blocking_type)
164 _setType(Mode::Gather);
165 m_receive_buf = receive_buf;
166 m_send_buffer = send_buf;
186 _setType(Mode::GatherVariableNeedComputeInfo);
187 m_local_reception_buffer = receive_array;
188 m_send_buffer = send_buf;
202 _setType(Mode::GatherVariable);
203 m_receive_buf = receive_buf;
204 m_send_buffer = send_buf;
205 m_receive_displacements = receive_displacements;
206 m_receive_counts = receive_counts;
Base class for 1D data vectors.
Brief information for a 'gather' message.
GatherMessageInfoBase()=default
Message for everyone and blocking.
bool isBlocking() const
Indicates if the message is blocking.
void print(std::ostream &o) const
Prints the message.
GatherMessageInfoBase(MessageRank dest_rank)
Blocking message having destination rank.
void setDestinationRank(MessageRank rank)
Sets the rank of the message destination.
GatherMessageInfoBase(MessageRank dest_rank, eBlockingType blocking_type)
Message having destination dest_rank and blocking mode blocking_type.
MessageRank destinationRank() const
Rank of the message destination.
Mode mode() const
Message mode.
Span< const DataType > sendBuffer() const
Send buffer. It is used in all modes.
GatherMessageInfo()=default
Message for everyone and blocking.
Array< DataType > * localReceptionBuffer() const
Receive buffer for the T_GatherVariableNeedComputeInfo type.
GatherMessageInfo(MessageRank dest_rank, eBlockingType blocking_type)
Message having destination dest_rank and blocking mode blocking_type.
Span< const Int32 > receiveCounts() const
Counts array. Used in GatherVariable mode.
Span< DataType > receiveBuffer() const
Receive buffer. Used in Gather and GatherVariable mode by ranks that receive.
void setGatherVariable(Span< const DataType > send_buf, Array< DataType > *receive_array)
Brief message equivalent to MPI_Gatherv or MPI_Allgatherv.
GatherMessageInfo(MessageRank dest_rank)
Blocking message having destination rank.
void setGather(Span< const DataType > send_buf, Span< DataType > receive_buf)
Brief message equivalent to MPI_Gather or MPI_Allgather.
Span< const Int32 > receiveDisplacement()
Displacement array. Used in GatherVariable mode.
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.
View of an array of elements of type T.
Declarations of types and methods used by message exchange mechanisms.
eBlockingType
Type indicating whether a message is blocking or not.