Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
Messages.h
Aller à la documentation de ce fichier.
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Messages.h (C) 2000-2024 */
9/* */
10/* Interface du gestionnaire des échanges de messages. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSING_MESSAGES_H
13#define ARCCORE_MESSAGEPASSING_MESSAGES_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
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"
21
23#include "arccore/base/Span.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34#define ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(type) \
35 \
36 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
37 mpAllGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf); \
38 \
39 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
40 mpGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 rank); \
41 \
42 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
43 mpNonBlockingAllGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf); \
44 \
45 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
46 mpNonBlockingGather(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 rank); \
47 \
48 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
49 mpAllGatherVariable(IMessagePassingMng* pm, Span<const type> send_buf, Array<type>& recv_buf); \
50 \
51 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
52 mpGatherVariable(IMessagePassingMng* pm, Span<const type> send_buf, Array<type>& recv_buf, Int32 rank); \
53 \
54 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
55 mpGather(IMessagePassingMng* pm, GatherMessageInfo<type>& gather_info); \
56 \
57 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
58 mpScatterVariable(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 root); \
59 \
60 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT type \
61 mpAllReduce(IMessagePassingMng* pm, eReduceType rt, type v); \
62 \
63 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
64 mpAllReduce(IMessagePassingMng* pm, eReduceType rt, Span<type> buf); \
65 \
66 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
67 mpNonBlockingAllReduce(IMessagePassingMng* pm, eReduceType rt, Span<const type> send_buf, Span<type> recv_buf); \
68 \
69 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
70 mpBroadcast(IMessagePassingMng* pm, Span<type> send_buf, Int32 rank); \
71 \
72 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
73 mpNonBlockingBroadcast(IMessagePassingMng* pm, Span<type> send_buf, Int32 rank); \
74 \
75 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
76 mpSend(IMessagePassingMng* pm, Span<const type> values, Int32 rank); \
77 \
78 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
79 mpReceive(IMessagePassingMng* pm, Span<type> values, Int32 rank); \
80 \
81 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
82 mpSend(IMessagePassingMng* pm, Span<const type> values, Int32 rank, bool is_blocked); \
83 \
84 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
85 mpSend(IMessagePassingMng* pm, Span<const type> values, const PointToPointMessageInfo& message); \
86 \
87 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
88 mpReceive(IMessagePassingMng* pm, Span<type> values, Int32 rank, bool is_blocked); \
89 \
90 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
91 mpReceive(IMessagePassingMng* pm, Span<type> values, const PointToPointMessageInfo& message); \
92 \
93 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT void \
94 mpAllToAll(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 count); \
95 \
96 extern "C++" ARCCORE_MESSAGEPASSING_EXPORT Request \
97 mpNonBlockingAllToAll(IMessagePassingMng* pm, Span<const type> send_buf, Span<type> recv_buf, Int32 count); \
98 \
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); \
103 \
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);
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
116ARCCORE_MESSAGEPASSING_EXPORT Ref<IRequestList>
117mpCreateRequestListRef(IMessagePassingMng* pm);
118
119/*---------------------------------------------------------------------------*/
120/*---------------------------------------------------------------------------*/
124ARCCORE_MESSAGEPASSING_EXPORT void
125mpWaitAll(IMessagePassingMng* pm, ArrayView<Request> requests);
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
132ARCCORE_MESSAGEPASSING_EXPORT void
133mpWait(IMessagePassingMng* pm, Request request);
134
135/*---------------------------------------------------------------------------*/
136/*---------------------------------------------------------------------------*/
143ARCCORE_MESSAGEPASSING_EXPORT void
144mpWaitSome(IMessagePassingMng* pm, ArrayView<Request> requests, ArrayView<bool> indexes);
145
146/*---------------------------------------------------------------------------*/
147/*---------------------------------------------------------------------------*/
154ARCCORE_MESSAGEPASSING_EXPORT void
155mpTestSome(IMessagePassingMng* pm, ArrayView<Request> requests, ArrayView<bool> indexes);
156
157/*---------------------------------------------------------------------------*/
158/*---------------------------------------------------------------------------*/
165ARCCORE_MESSAGEPASSING_EXPORT void
166mpWait(IMessagePassingMng* pm, ArrayView<Request> requests,
167 ArrayView<bool> indexes, eWaitType wait_type);
168
169/*---------------------------------------------------------------------------*/
170/*---------------------------------------------------------------------------*/
188ARCCORE_MESSAGEPASSING_EXPORT MessageId
189mpProbe(IMessagePassingMng* pm, const PointToPointMessageInfo& message);
190
191/*---------------------------------------------------------------------------*/
192/*---------------------------------------------------------------------------*/
210ARCCORE_MESSAGEPASSING_EXPORT MessageSourceInfo
211mpLegacyProbe(IMessagePassingMng* pm, const PointToPointMessageInfo& message);
212
213/*---------------------------------------------------------------------------*/
214/*---------------------------------------------------------------------------*/
223ARCCORE_MESSAGEPASSING_EXPORT IMessagePassingMng*
224mpSplit(IMessagePassingMng* pm, bool keep);
225
226/*---------------------------------------------------------------------------*/
227/*---------------------------------------------------------------------------*/
233ARCCORE_MESSAGEPASSING_EXPORT void
234mpBarrier(IMessagePassingMng* pm);
235
236/*---------------------------------------------------------------------------*/
237/*---------------------------------------------------------------------------*/
241ARCCORE_MESSAGEPASSING_EXPORT Request
242mpNonBlockingBarrier(IMessagePassingMng* pm);
243
244/*---------------------------------------------------------------------------*/
245/*---------------------------------------------------------------------------*/
251ARCCORE_MESSAGEPASSING_EXPORT Ref<ISerializeMessageList>
252mpCreateSerializeMessageListRef(IMessagePassingMng* pm);
253
255ARCCORE_MESSAGEPASSING_EXPORT Request
256mpSend(IMessagePassingMng* pm, const ISerializer* values, const PointToPointMessageInfo& message);
257
259ARCCORE_MESSAGEPASSING_EXPORT Request
260mpReceive(IMessagePassingMng* pm, ISerializer* values, const PointToPointMessageInfo& message);
261
263ARCCORE_MESSAGEPASSING_EXPORT void
264mpAllGather(IMessagePassingMng* pm, const ISerializer* send_serializer, ISerializer* recv_serializer);
265
266/*---------------------------------------------------------------------------*/
267/*---------------------------------------------------------------------------*/
268
269ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(char)
270ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(signed char)
271ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(unsigned char)
272
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)
281
282ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(float)
283ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(double)
284ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(long double)
285
286ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(BFloat16)
287ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE(Float16)
288
289#undef ARCCORE_GENERATE_MESSAGEPASSING_PROTOTYPE
290
291/*---------------------------------------------------------------------------*/
292/*---------------------------------------------------------------------------*/
293
294} // End namespace Arccore::MessagePassing
295
296/*---------------------------------------------------------------------------*/
297/*---------------------------------------------------------------------------*/
298
299#endif
Espace de nommage contenant les types et déclarations qui gèrent le mécanisme de parallélisme par éch...
Request mpNonBlockingBarrier(IMessagePassingMng *pm)
Effectue une barrière non bloquante.
Definition Messages.cc:246
void mpBarrier(IMessagePassingMng *pm)
Effectue une barrière.
Definition Messages.cc:236
void mpAllGather(IMessagePassingMng *pm, const ISerializer *send_serializer, ISerializer *receive_serialize)
Message allGather() pour une sérialisation.
Definition Messages.cc:296
IMessagePassingMng * mpSplit(IMessagePassingMng *pm, bool keep)
Créé une nouvelle instance de IMessagePassingMng.
Definition Messages.cc:227
MessageId mpProbe(IMessagePassingMng *pm, const PointToPointMessageInfo &message)
Teste si un message est disponible.
Definition Messages.cc:207
Request mpSend(IMessagePassingMng *pm, const ISerializer *values, const PointToPointMessageInfo &message)
Message d'envoi utilisant un ISerializer.
Definition Messages.cc:266
MessageSourceInfo mpLegacyProbe(IMessagePassingMng *pm, const PointToPointMessageInfo &message)
Teste si un message est disponible.
Definition Messages.cc:217
Ref< ISerializeMessageList > mpCreateSerializeMessageListRef(IMessagePassingMng *pm)
Créé une liste de messages de sérialisation.
Definition Messages.cc:256
void mpWaitAll(IMessagePassingMng *pm, ArrayView< Request > requests)
Bloque tant que les requêtes de requests ne sont pas terminées.
Definition Messages.cc:151
void mpTestSome(IMessagePassingMng *pm, ArrayView< Request > requests, ArrayView< bool > indexes)
Teste si des requêtes de request sont terminées.
Definition Messages.cc:177
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.
Definition Messages.cc:168
void mpWait(IMessagePassingMng *pm, Request request)
Bloque jusqu'à ce que la requête request soit terminée.
Definition Messages.cc:160
Request mpReceive(IMessagePassingMng *pm, ISerializer *values, const PointToPointMessageInfo &message)
Message de réception utilisant un ISerializer.
Definition Messages.cc:277
Ref< IRequestList > mpCreateRequestListRef(IMessagePassingMng *pm)
Créé une liste de requêtes.
Definition Messages.cc:142