12#ifndef ARCCORE_MESSAGEPASSING_MESSAGES_H
13#define ARCCORE_MESSAGEPASSING_MESSAGES_H
17#include "arccore/message_passing/IMessagePassingMng.h"
18#include "arccore/message_passing/IDispatchers.h"
19#include "arccore/message_passing/ITypeDispatcher.h"
20#include "arccore/message_passing/Request.h"
34#define ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(type) \
36 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
37 mpAllGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf); \
39 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
40 mpGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 rank); \
42 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
43 mpNonBlockingAllGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf); \
45 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
46 mpNonBlockingGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 rank); \
48 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
49 mpAllGatherVariable(IMessagePassingMng* pm, Span<const type> send_buf, Array<type>& recv_buf); \
51 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
52 mpGatherVariable(IMessagePassingMng* pm, Span<const type> send_buf, Array<type>& recv_buf, Int32 rank); \
54 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
55 mpGather(IMessagePassingMng* pm, GatherMessageInfo<type>& gather_info); \
57 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
58 mpScatterVariable(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 root); \
60 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT type \
61 mpAllReduce(IMessagePassingMng* pm, eReduceType rt, type v); \
63 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
64 mpAllReduce(IMessagePassingMng* pm, eReduceType rt, Span<type> buf); \
66 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
67 mpAllReduce(IMessagePassingMng* pm, eReduceType rt, Span<const type> send_buf, Span<type> receive_buf); \
69 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
70 mpScanExclusive(IMessagePassingMng* pm, eReduceType rt, Span<const type> send_buf, Span<type> receive_buf); \
72 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
73 mpNonBlockingAllReduce(IMessagePassingMng* pm, eReduceType rt, Span<const type> send_buf, Span<type> recv_buf); \
75 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
76 mpBroadcast(IMessagePassingMng* pm, Span<type> send_buf, Int32 rank); \
78 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
79 mpNonBlockingBroadcast(IMessagePassingMng* pm, Span<type> send_buf, Int32 rank); \
81 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
82 mpSend(IMessagePassingMng* pm, Span<const type> values, Int32 rank); \
84 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
85 mpReceive(IMessagePassingMng* pm, Span<type> values, Int32 rank); \
87 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
88 mpSend(IMessagePassingMng* pm, Span<const type> values, Int32 rank, bool is_blocked); \
90 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
91 mpSend(IMessagePassingMng* pm, Span<const type> values, const PointToPointMessageInfo& message); \
93 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
94 mpReceive(IMessagePassingMng* pm, Span<type> values, Int32 rank, bool is_blocked); \
96 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
97 mpReceive(IMessagePassingMng* pm, Span<type> values, const PointToPointMessageInfo& message); \
99 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
100 mpAllToAll(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 count); \
102 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
103 mpNonBlockingAllToAll(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 count); \
105 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
106 mpAllToAllVariable(IMessagePassingMng* pm, Span<const type> send_buf, ConstArrayView<Int32> send_count, \
107 ConstArrayView<Int32> send_index, Span<type> recv_buf, \
108 ConstArrayView<Int32> recv_count, ConstArrayView<Int32> recv_index); \
110 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
111 mpNonBlockingAllToAllVariable(IMessagePassingMng* pm, Span<const type> send_buf, ConstArrayView<Int32> send_count, \
112 ConstArrayView<Int32> send_index, Span<type> recv_buf, \
113 ConstArrayView<Int32> recv_count, ConstArrayView<Int32> recv_index);
123ARCCORE_MESSAGEPASSING_EXPORT Ref<IRequestList>
132ARCCORE_MESSAGEPASSING_EXPORT
void
141ARCCORE_MESSAGEPASSING_EXPORT
void
153ARCCORE_MESSAGEPASSING_EXPORT
void
165ARCCORE_MESSAGEPASSING_EXPORT
void
177ARCCORE_MESSAGEPASSING_EXPORT
void
179 ArrayView<bool> indexes,
eWaitType wait_type);
239ARCCORE_DEPRECATED_REASON(
"Y2026: Use mpSplitCommunicator() instead.")
263ARCCORE_MESSAGEPASSING_EXPORT
void
272ARCCORE_MESSAGEPASSING_EXPORT
Request
287ARCCORE_MESSAGEPASSING_EXPORT
Request
291ARCCORE_MESSAGEPASSING_EXPORT
Request
295ARCCORE_MESSAGEPASSING_EXPORT
void
346ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
char)
347ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
signed char)
348ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned char)
350ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
short)
351ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned short)
352ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
int)
353ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned int)
354ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
long)
355ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned long)
356ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
long long)
357ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned long long)
359ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
float)
360ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
double)
361ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
long double)
364ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
Float16)
366#undef ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE
Types and functions associated with the classes SpanImpl, SmallSpan and Span.
Half-precision floating-point type.
Interface of the message passing manager.
Interface for a serialization message list.
Information about the source of a message.
Information for sending/receiving a point-to-point message.
Declarations of types and methods used by message exchange mechanisms.
C void mpGather(IMessagePassingMng *pm, Span< const char > send_buf, Span< char > recv_buf, Int32 rank)
Ref< ISerializeMessage > mpCreateSerializeMessage(IMessagePassingMng *pm, MessageRank target, ePointToPointMessageType type)
Creates a serialization message.
C void mpScatterVariable(IMessagePassingMng *pm, Span< const char > send_buf, Span< char > recv_buf, Int32 root)
C Request mpNonBlockingAllGather(IMessagePassingMng *pm, Span< const char > send_buf, Span< char > recv_buf)
C void mpBroadcast(IMessagePassingMng *pm, Span< char > send_buf, Int32 rank)
void mpTestSome(IMessagePassingMng *pm, ArrayView< Request > requests, ArrayView< bool > indexes)
Tests if any of the requests in request are finished.
Ref< ISerializeMessageList > mpCreateSerializeMessageListRef(IMessagePassingMng *pm)
Creates a serialization message list.
Ref< ISerializeMessage > mpCreateSendSerializeMessage(IMessagePassingMng *pm, MessageRank destination)
Creates a serialization message for sending.
MessageSourceInfo mpLegacyProbe(IMessagePassingMng *pm, const PointToPointMessageInfo &message)
Tests if a message is available.
Ref< IMessagePassingMng > mpSplitCommunicator(IMessagePassingMng *pm, bool keep)
Creates a sub communicator.
Ref< ISerializeMessage > mpCreateReceiveSerializeMessage(IMessagePassingMng *pm, MessageRank source)
Creates a serialization message for receiving.
MessageId mpProbe(IMessagePassingMng *pm, const PointToPointMessageInfo &message)
Tests if a message is available.
C void mpAllToAll(IMessagePassingMng *pm, Span< const char > send_buf, Span< char > recv_buf, Int32 count)
C Request mpNonBlockingAllToAll(IMessagePassingMng *pm, Span< const char > send_buf, Span< char > recv_buf, Int32 count)
C void mpAllToAllVariable(IMessagePassingMng *pm, Span< const char > send_buf, ConstArrayView< Int32 > send_count, ConstArrayView< Int32 > send_index, Span< char > recv_buf, ConstArrayView< Int32 > recv_count, ConstArrayView< Int32 > recv_index)
C void mpGatherVariable(IMessagePassingMng *pm, Span< const char > send_buf, Array< char > &recv_buf, Int32 rank)
C char mpAllReduce(IMessagePassingMng *pm, eReduceType rt, char v)
Ref< IRequestList > mpCreateRequestListRef(IMessagePassingMng *pm)
Creates a list of requests.
C void mpAllGatherVariable(IMessagePassingMng *pm, Span< const char > send_buf, Array< char > &recv_buf)
void mpBarrier(IMessagePassingMng *pm)
Performs a barrier.
Request mpNonBlockingBarrier(IMessagePassingMng *pm)
Performs a non-blocking barrier.
void mpWait(IMessagePassingMng *pm, Request request)
Blocks until the request request is finished.
void mpAllGather(IMessagePassingMng *pm, const ISerializer *send_serializer, ISerializer *receive_serialize)
allGather() message for serialization
void mpWaitAll(IMessagePassingMng *pm, ArrayView< Request > requests)
Blocks until the requests in requests are finished.
IMessagePassingMng * mpSplit(IMessagePassingMng *pm, bool keep)
Creates a sub communicator.
C Request mpNonBlockingAllToAllVariable(IMessagePassingMng *pm, Span< const char > send_buf, ConstArrayView< Int32 > send_count, ConstArrayView< Int32 > send_index, Span< char > recv_buf, ConstArrayView< Int32 > recv_count, ConstArrayView< Int32 > recv_index)
ePointToPointMessageType
Point-to-point message type.
C Request mpNonBlockingGather(IMessagePassingMng *pm, Span< const char > send_buf, Span< char > recv_buf, Int32 rank)
Request mpReceive(IMessagePassingMng *pm, ISerializer *values, const PointToPointMessageInfo &message)
Receive message using an ISerializer.
void mpWaitSome(IMessagePassingMng *pm, ArrayView< Request > requests, ArrayView< bool > indexes)
Blocks until at least one of the requests in request is finished.
C Request mpNonBlockingBroadcast(IMessagePassingMng *pm, Span< char > send_buf, Int32 rank)
Request mpSend(IMessagePassingMng *pm, const ISerializer *values, const PointToPointMessageInfo &message)
Send message using an ISerializer.
C Request mpNonBlockingAllReduce(IMessagePassingMng *pm, eReduceType rt, Span< const char > send_buf, Span< char > recv_buf)
Namespace containing the types and declarations that manage the message-passing parallelism mechanism...