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"
23#include "arccore/base/Span.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 Request \
67 mpNonBlockingAllReduce(IMessagePassingMng* pm, eReduceType rt, Span<const type> send_buf, Span<type> recv_buf); \
69 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
70 mpBroadcast(IMessagePassingMng* pm, Span<type> send_buf, Int32 rank); \
72 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
73 mpNonBlockingBroadcast(IMessagePassingMng* pm, Span<type> send_buf, Int32 rank); \
75 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
76 mpSend(IMessagePassingMng* pm, Span<const type> values, Int32 rank); \
78 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
79 mpReceive(IMessagePassingMng* pm, Span<type> values, Int32 rank); \
81 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
82 mpSend(IMessagePassingMng* pm, Span<const type> values, Int32 rank, bool is_blocked); \
84 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
85 mpSend(IMessagePassingMng* pm, Span<const type> values, const PointToPointMessageInfo& message); \
87 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
88 mpReceive(IMessagePassingMng* pm, Span<type> values, Int32 rank, bool is_blocked); \
90 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
91 mpReceive(IMessagePassingMng* pm, Span<type> values, const PointToPointMessageInfo& message); \
93 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
94 mpAllToAll(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 count); \
96 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
97 mpNonBlockingAllToAll(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 count); \
99 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
100 mpAllToAllVariable(IMessagePassingMng* pm, Span<const type> send_buf, ConstArrayView<Int32> send_count, \
101 ConstArrayView<Int32> send_index, Span<type> recv_buf, \
102 ConstArrayView<Int32> recv_count, ConstArrayView<Int32> recv_index); \
104 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
105 mpNonBlockingAllToAllVariable(IMessagePassingMng* pm, Span<const type> send_buf, ConstArrayView<Int32> send_count, \
106 ConstArrayView<Int32> send_index, Span<type> recv_buf, \
107 ConstArrayView<Int32> recv_count, ConstArrayView<Int32> recv_index);
116ARCCORE_MESSAGEPASSING_EXPORT Ref<IRequestList>
124ARCCORE_MESSAGEPASSING_EXPORT
void
125mpWaitAll(IMessagePassingMng* pm, ArrayView<Request> requests);
132ARCCORE_MESSAGEPASSING_EXPORT
void
133mpWait(IMessagePassingMng* pm, Request request);
143ARCCORE_MESSAGEPASSING_EXPORT
void
144mpWaitSome(IMessagePassingMng* pm, ArrayView<Request> requests, ArrayView<bool> indexes);
154ARCCORE_MESSAGEPASSING_EXPORT
void
155mpTestSome(IMessagePassingMng* pm, ArrayView<Request> requests, ArrayView<bool> indexes);
165ARCCORE_MESSAGEPASSING_EXPORT
void
166mpWait(IMessagePassingMng* pm, ArrayView<Request> requests,
167 ArrayView<bool> indexes,
eWaitType wait_type);
188ARCCORE_MESSAGEPASSING_EXPORT MessageId
189mpProbe(IMessagePassingMng* pm,
const PointToPointMessageInfo& message);
210ARCCORE_MESSAGEPASSING_EXPORT MessageSourceInfo
211mpLegacyProbe(IMessagePassingMng* pm,
const PointToPointMessageInfo& message);
223ARCCORE_MESSAGEPASSING_EXPORT IMessagePassingMng*
224mpSplit(IMessagePassingMng* pm,
bool keep);
233ARCCORE_MESSAGEPASSING_EXPORT
void
241ARCCORE_MESSAGEPASSING_EXPORT Request
251ARCCORE_MESSAGEPASSING_EXPORT Ref<ISerializeMessageList>
255ARCCORE_MESSAGEPASSING_EXPORT Request
256mpSend(IMessagePassingMng* pm,
const ISerializer* values,
const PointToPointMessageInfo& message);
259ARCCORE_MESSAGEPASSING_EXPORT Request
260mpReceive(IMessagePassingMng* pm, ISerializer* values,
const PointToPointMessageInfo& message);
263ARCCORE_MESSAGEPASSING_EXPORT
void
264mpAllGather(IMessagePassingMng* pm,
const ISerializer* send_serializer, ISerializer* recv_serializer);
269ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
char)
270ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
signed char)
271ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned char)
273ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
short)
274ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned short)
275ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
int)
276ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned int)
277ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
long)
278ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned long)
279ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
long long)
280ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
unsigned long long)
282ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
float)
283ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
double)
284ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
long double)
287ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(
Float16)
289#undef ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE
Type flottant demi-précision.
Espace de nommage contenant les types et déclarations qui gèrent le mécanisme de parallélisme par éch...
void mpWaitSome(IMessagePassingMng *pm, ArrayView< Request > requests, ArrayView< bool > indexes)
Bloque jusqu'à ce qu'au moins une des requêtes de request soit terminée.
IMessagePassingMng * mpSplit(IMessagePassingMng *pm, bool keep)
Créé une nouvelle instance de IMessagePassingMng.
Request mpReceive(IMessagePassingMng *pm, ISerializer *values, const PointToPointMessageInfo &message)
Message de réception utilisant un ISerializer.
void mpBarrier(IMessagePassingMng *pm)
Effectue une barrière.
MessageId mpProbe(IMessagePassingMng *pm, const PointToPointMessageInfo &message)
Teste si un message est disponible.
Ref< IRequestList > mpCreateRequestListRef(IMessagePassingMng *pm)
Créé une liste de requêtes.
void mpAllGather(IMessagePassingMng *pm, const ISerializer *send_serializer, ISerializer *receive_serialize)
Message allGather() pour une sérialisation.
void mpWaitAll(IMessagePassingMng *pm, ArrayView< Request > requests)
Bloque tant que les requêtes de requests ne sont pas terminées.
Request mpNonBlockingBarrier(IMessagePassingMng *pm)
Effectue une barrière non bloquante.
void mpTestSome(IMessagePassingMng *pm, ArrayView< Request > requests, ArrayView< bool > indexes)
Teste si des requêtes de request sont terminées.
Ref< ISerializeMessageList > mpCreateSerializeMessageListRef(IMessagePassingMng *pm)
Créé une liste de messages de sérialisation.
Request mpSend(IMessagePassingMng *pm, const ISerializer *values, const PointToPointMessageInfo &message)
Message d'envoi utilisant un ISerializer.
void mpWait(IMessagePassingMng *pm, Request request)
Bloque jusqu'à ce que la requête request soit terminée.
MessageSourceInfo mpLegacyProbe(IMessagePassingMng *pm, const PointToPointMessageInfo &message)
Teste si un message est disponible.