Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IParallelNonBlockingCollective.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* IParallelNonBlockingCollective.h (C) 2000-2025 */
9/* */
10/* Interface for non-blocking collective parallel operations. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IPARALLELNONBLOCKINGCOLLECTIVE_H
13#define ARCANE_CORE_IPARALLELNONBLOCKINGCOLLECTIVE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25/*!
26 * NOTE:
27 * The goal is that IParallelNonBlockingCollective possesses the same
28 * collective methods as IParallelMng. However, some collective methods in
29 * IParallleMng actually call multiple collective operations in their
30 * implementation. It is therefore not possible to transform this directly
31 * into collective operations. To implement this with MPI, it would be
32 * necessary to be able to associate a callback with each request (this
33 * callback would be called when the request is finished) which would allow
34 * operations to continue. But this is not currently available (perhaps this
35 * is possible with generalized requests). For now, we remove these calls
36 * from the interface by protecting them with a define _NEED_ADVANCED_NBC.
37 */
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42namespace Arcane
43{
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
48/*!
49 * \ingroup Parallel
50 * \brief Interface for non-blocking collective parallel operations.
51 */
52class ARCANE_CORE_EXPORT IParallelNonBlockingCollective
53{
54 public:
55
56 virtual ~IParallelNonBlockingCollective() = default; //!< Releases resources.
57
58 public:
59
60 typedef Parallel::Request Request;
61 typedef Parallel::eReduceType eReduceType;
62
63 public:
64
65 //! Constructs the instance.
66 virtual void build() = 0;
67
68 public:
69
70 //! Associated parallelism manager.
71 virtual IParallelMng* parallelMng() const = 0;
72
73 public:
74
75 //! @name allGather
76 //@{
77 /*!
78 * \brief Performs a gather on all processors.
79 * This is a collective operation. The array \a send_buf
80 * must have the same size, denoted \a n, for all processors and
81 * the array \a recv_buf must have a size equal to the number
82 * of processors multiplied by \a n.
83 */
84 virtual Request allGather(ConstArrayView<char> send_buf, ArrayView<char> recv_buf) = 0;
85 virtual Request allGather(ConstArrayView<unsigned char> send_buf, ArrayView<unsigned char> recv_buf) = 0;
86 virtual Request allGather(ConstArrayView<signed char> send_buf, ArrayView<signed char> recv_buf) = 0;
87 virtual Request allGather(ConstArrayView<int> send_buf, ArrayView<int> recv_buf) = 0;
88 virtual Request allGather(ConstArrayView<unsigned int> send_buf, ArrayView<unsigned int> recv_buf) = 0;
89 virtual Request allGather(ConstArrayView<short> send_buf, ArrayView<short> recv_buf) = 0;
90 virtual Request allGather(ConstArrayView<unsigned short> send_buf, ArrayView<unsigned short> recv_buf) = 0;
91 virtual Request allGather(ConstArrayView<long> send_buf, ArrayView<long> recv_buf) = 0;
92 virtual Request allGather(ConstArrayView<unsigned long> send_buf, ArrayView<unsigned long> recv_buf) = 0;
93 virtual Request allGather(ConstArrayView<long long> send_buf, ArrayView<long long> recv_buf) = 0;
95 virtual Request allGather(ConstArrayView<float> send_buf, ArrayView<float> recv_buf) = 0;
96 virtual Request allGather(ConstArrayView<double> send_buf, ArrayView<double> recv_buf) = 0;
97 virtual Request allGather(ConstArrayView<long double> send_buf, ArrayView<long double> recv_buf) = 0;
98#ifdef ARCANE_REAL_NOT_BUILTIN
99 virtual Request allGather(ConstArrayView<Real> send_buf, ArrayView<Real> recv_buf) = 0;
100#endif
101 virtual Request allGather(ConstArrayView<Real2> send_buf, ArrayView<Real2> recv_buf) = 0;
102 virtual Request allGather(ConstArrayView<Real3> send_buf, ArrayView<Real3> recv_buf) = 0;
103 virtual Request allGather(ConstArrayView<Real2x2> send_buf, ArrayView<Real2x2> recv_buf) = 0;
104 virtual Request allGather(ConstArrayView<Real3x3> send_buf, ArrayView<Real3x3> recv_buf) = 0;
105 virtual Request allGather(ConstArrayView<HPReal> send_buf, ArrayView<HPReal> recv_buf) = 0;
106 //virtual Request allGather(ISerializer* send_serializer,ISerializer* recv_serializer) =0;
107 //@}
108
109 //! @name gather
110 //@{
111 /*!
112 * \brief Performs a gather on one processor.
113 * This is a collective operation. The array \a send_buf
114 * must have the same size, denoted \a n, for all processors and
115 * the array \a recv_buf for processor \a rank must have a size equal to the number
116 * of processors multiplied by \a n. This array \a recv_buf is unused for
117 * ranks other than \a rank.
118 */
119 virtual Request gather(ConstArrayView<char> send_buf, ArrayView<char> recv_buf, Integer rank) = 0;
120 virtual Request gather(ConstArrayView<unsigned char> send_buf, ArrayView<unsigned char> recv_buf, Integer rank) = 0;
121 virtual Request gather(ConstArrayView<signed char> send_buf, ArrayView<signed char> recv_buf, Integer rank) = 0;
122 virtual Request gather(ConstArrayView<int> send_buf, ArrayView<int> recv_buf, Integer rank) = 0;
123 virtual Request gather(ConstArrayView<unsigned int> send_buf, ArrayView<unsigned int> recv_buf, Integer rank) = 0;
124 virtual Request gather(ConstArrayView<short> send_buf, ArrayView<short> recv_buf, Integer rank) = 0;
125 virtual Request gather(ConstArrayView<unsigned short> send_buf, ArrayView<unsigned short> recv_buf, Integer rank) = 0;
126 virtual Request gather(ConstArrayView<long> send_buf, ArrayView<long> recv_buf, Integer rank) = 0;
127 virtual Request gather(ConstArrayView<unsigned long> send_buf, ArrayView<unsigned long> recv_buf, Integer rank) = 0;
128 virtual Request gather(ConstArrayView<long long> send_buf, ArrayView<long long> recv_buf, Integer rank) = 0;
129 virtual Request gather(ConstArrayView<unsigned long long> send_buf, ArrayView<unsigned long long> recv_buf, Integer rank) = 0;
130 virtual Request gather(ConstArrayView<float> send_buf, ArrayView<float> recv_buf, Integer rank) = 0;
131 virtual Request gather(ConstArrayView<double> send_buf, ArrayView<double> recv_buf, Integer rank) = 0;
132 virtual Request gather(ConstArrayView<long double> send_buf, ArrayView<long double> recv_buf, Integer rank) = 0;
133#ifdef ARCANE_REAL_NOT_BUILTIN
134 virtual Request gather(ConstArrayView<Real> send_buf, ArrayView<Real> recv_buf, Integer rank) = 0;
135#endif
136 virtual Request gather(ConstArrayView<Real2> send_buf, ArrayView<Real2> recv_buf, Integer rank) = 0;
137 virtual Request gather(ConstArrayView<Real3> send_buf, ArrayView<Real3> recv_buf, Integer rank) = 0;
138 virtual Request gather(ConstArrayView<Real2x2> send_buf, ArrayView<Real2x2> recv_buf, Integer rank) = 0;
139 virtual Request gather(ConstArrayView<Real3x3> send_buf, ArrayView<Real3x3> recv_buf, Integer rank) = 0;
140 virtual Request gather(ConstArrayView<HPReal> send_buf, ArrayView<HPReal> recv_buf, Integer rank) = 0;
141 //virtual void gather(ISerializer* send_serializer,ISerializer* recv_serializer,Integer rank) =0;
142 //@}
143
144 //! @name allGather variable
145 //@{
146
147#if _NEED_ADVANCED_NBC
148 /*!
149 * \brief Performs a gather on all processors.
150 *
151 * This is a collective operation. The number of elements in the array
152 * \a send_buf can be different for each processor. The array
153 * \a recv_buf contains the concatenation of the arrays \a send_buf
154 * from each processor as output. This array \a recv_buf may be resized
155 * for the processor of rank \a rank.
156 */
157 virtual Request gatherVariable(ConstArrayView<char> send_buf,
158 Array<char>& recv_buf, Integer rank) = 0;
159 virtual Request gatherVariable(ConstArrayView<signed char> send_buf,
160 Array<signed char>& recv_buf, Integer rank) = 0;
161 virtual Request gatherVariable(ConstArrayView<unsigned char> send_buf,
162 Array<unsigned char>& recv_buf, Integer rank) = 0;
163 virtual Request gatherVariable(ConstArrayView<int> send_buf,
164 Array<int>& recv_buf, Integer rank) = 0;
165 virtual Request gatherVariable(ConstArrayView<unsigned int> send_buf,
166 Array<unsigned int>& recv_buf, Integer rank) = 0;
167 virtual Request gatherVariable(ConstArrayView<short> send_buf,
168 Array<short>& recv_buf, Integer rank) = 0;
169 virtual Request gatherVariable(ConstArrayView<unsigned short> send_buf,
170 Array<unsigned short>& recv_buf, Integer rank) = 0;
171 virtual Request gatherVariable(ConstArrayView<long> send_buf,
172 Array<long>& recv_buf, Integer rank) = 0;
173 virtual Request gatherVariable(ConstArrayView<unsigned long> send_buf,
174 Array<unsigned long>& recv_buf, Integer rank) = 0;
175 virtual Request gatherVariable(ConstArrayView<long long> send_buf,
176 Array<long long>& recv_buf, Integer rank) = 0;
177 virtual Request gatherVariable(ConstArrayView<unsigned long long> send_buf,
178 Array<unsigned long long>& recv_buf, Integer rank) = 0;
179 virtual Request gatherVariable(ConstArrayView<float> send_buf,
180 Array<float>& recv_buf, Integer rank) = 0;
181 virtual Request gatherVariable(ConstArrayView<double> send_buf,
182 Array<double>& recv_buf, Integer rank) = 0;
183 virtual Request gatherVariable(ConstArrayView<long double> send_buf,
184 Array<long double>& recv_buf, Integer rank) = 0;
185#ifdef ARCANE_REAL_NOT_BUILTIN
186 virtual Request gatherVariable(ConstArrayView<Real> send_buf,
187 Array<Real>& recv_buf, Integer rank) = 0;
188#endif
189 virtual Request gatherVariable(ConstArrayView<Real2> send_buf,
190 Array<Real2>& recv_buf, Integer rank) = 0;
191 virtual Request gatherVariable(ConstArrayView<Real3> send_buf,
192 Array<Real3>& recv_buf, Integer rank) = 0;
193 virtual Request gatherVariable(ConstArrayView<Real2x2> send_buf,
194 Array<Real2x2>& recv_buf, Integer rank) = 0;
195 virtual Request gatherVariable(ConstArrayView<Real3x3> send_buf,
196 Array<Real3x3>& recv_buf, Integer rank) = 0;
197 virtual Request gatherVariable(ConstArrayView<HPReal> send_buf,
198 Array<HPReal>& recv_buf, Integer rank) = 0;
199 //@}
200#endif
201
202 //! @name allGather variable
203 //@{
204
205#if _NEED_ADVANCED_NBC
206 /*!
207 * \brief Performs a gather on all processors.
208 *
209 * This is a collective operation. The number of elements in the array
210 * \a send_buf can be different for each processor. The array
211 * \a recv_buf contains the concatenation of the arrays \a send_buf
212 * from each processor as output. This array \a recv_buf may be resized.
213 */
214 virtual Request allGatherVariable(ConstArrayView<char> send_buf,
215 Array<char>& recv_buf) = 0;
216 virtual Request allGatherVariable(ConstArrayView<signed char> send_buf,
217 Array<signed char>& recv_buf) = 0;
218 virtual Request allGatherVariable(ConstArrayView<unsigned char> send_buf,
219 Array<unsigned char>& recv_buf) = 0;
220 virtual Request allGatherVariable(ConstArrayView<int> send_buf,
221 Array<int>& recv_buf) = 0;
222 virtual Request allGatherVariable(ConstArrayView<unsigned int> send_buf,
223 Array<unsigned int>& recv_buf) = 0;
224 virtual Request allGatherVariable(ConstArrayView<short> send_buf,
225 Array<short>& recv_buf) = 0;
226 virtual Request allGatherVariable(ConstArrayView<unsigned short> send_buf,
227 Array<unsigned short>& recv_buf) = 0;
228 virtual Request allGatherVariable(ConstArrayView<long> send_buf,
229 Array<long>& recv_buf) = 0;
230 virtual Request allGatherVariable(ConstArrayView<unsigned long> send_buf,
231 Array<unsigned long>& recv_buf) = 0;
232 virtual Request allGatherVariable(ConstArrayView<long long> send_buf,
233 Array<long long>& recv_buf) = 0;
234 virtual Request allGatherVariable(ConstArrayView<unsigned long long> send_buf,
235 Array<unsigned long long>& recv_buf) = 0;
236 virtual Request allGatherVariable(ConstArrayView<float> send_buf,
237 Array<float>& recv_buf) = 0;
238 virtual Request allGatherVariable(ConstArrayView<double> send_buf,
239 Array<double>& recv_buf) = 0;
240 virtual Request allGatherVariable(ConstArrayView<long double> send_buf,
241 Array<long double>& recv_buf) = 0;
242#ifdef ARCANE_REAL_NOT_BUILTIN
243 virtual Request allGatherVariable(ConstArrayView<Real> send_buf,
244 Array<Real>& recv_buf) = 0;
245#endif
246 virtual Request allGatherVariable(ConstArrayView<Real2> send_buf,
247 Array<Real2>& recv_buf) = 0;
248 virtual Request allGatherVariable(ConstArrayView<Real3> send_buf,
249 Array<Real3>& recv_buf) = 0;
250 virtual Request allGatherVariable(ConstArrayView<Real2x2> send_buf,
251 Array<Real2x2>& recv_buf) = 0;
252 virtual Request allGatherVariable(ConstArrayView<Real3x3> send_buf,
253 Array<Real3x3>& recv_buf) = 0;
254 virtual Request allGatherVariable(ConstArrayView<HPReal> send_buf,
255 Array<HPReal>& recv_buf) = 0;
256 //@}
257#endif
258
259#if _NEED_ADVANCED_NBC
260 //! @name scalar reduction operations
261 //@{
262 /*!
263 * \brief Splits an array across multiple processors.
264 */
265 virtual Request scatterVariable(ConstArrayView<char> send_buf,
266 ArrayView<char> recv_buf, Integer root) = 0;
267 virtual Request scatterVariable(ConstArrayView<signed char> send_buf,
268 ArrayView<signed char> recv_buf, Integer root) = 0;
269 virtual Request scatterVariable(ConstArrayView<unsigned char> send_buf,
270 ArrayView<unsigned char> recv_buf, Integer root) = 0;
271 virtual Request scatterVariable(ConstArrayView<int> send_buf,
272 ArrayView<int> recv_buf, Integer root) = 0;
273 virtual Request scatterVariable(ConstArrayView<unsigned int> send_buf,
274 ArrayView<unsigned int> recv_buf, Integer root) = 0;
275 virtual Request scatterVariable(ConstArrayView<long> send_buf,
276 ArrayView<long> recv_buf, Integer root) = 0;
277 virtual Request scatterVariable(ConstArrayView<unsigned long> send_buf,
278 ArrayView<unsigned long> recv_buf, Integer root) = 0;
279 virtual Request scatterVariable(ConstArrayView<long long> send_buf,
280 ArrayView<long long> recv_buf, Integer root) = 0;
281 virtual Request scatterVariable(ConstArrayView<unsigned long long> send_buf,
282 ArrayView<unsigned long long> recv_buf, Integer root) = 0;
283 virtual Request scatterVariable(ConstArrayView<float> send_buf,
284 ArrayView<float> recv_buf, Integer root) = 0;
285 virtual Request scatterVariable(ConstArrayView<double> send_buf,
286 ArrayView<double> recv_buf, Integer root) = 0;
287 virtual Request scatterVariable(ConstArrayView<long double> send_buf,
288 ArrayView<long double> recv_buf, Integer root) = 0;
289#ifdef ARCANE_REAL_NOT_BUILTIN
290 virtual Request scatterVariable(ConstArrayView<Real> send_buf,
291 ArrayView<Real> recv_buf, Integer root) = 0;
292#endif
293 virtual Request scatterVariable(ConstArrayView<Real2> send_buf,
294 ArrayView<Real2> recv_buf, Integer root) = 0;
295 virtual Request scatterVariable(ConstArrayView<Real3> send_buf,
296 ArrayView<Real3> recv_buf, Integer root) = 0;
297 virtual Request scatterVariable(ConstArrayView<Real2x2> send_buf,
298 ArrayView<Real2x2> recv_buf, Integer root) = 0;
299 virtual Request scatterVariable(ConstArrayView<Real3x3> send_buf,
300 ArrayView<Real3x3> recv_buf, Integer root) = 0;
301 virtual Request scatterVariable(ConstArrayView<HPReal> send_buf,
302 ArrayView<HPReal> recv_buf, Integer root) = 0;
303 //@}
304#endif
305
306 //! @name Array reduction operations
307 //@{
308 /*!
309 * \brief Performs the reduction of type \a rt on the array \a send_buf and
310 * stores the result in \a recv_buf.
311 */
312 virtual Request allReduce(eReduceType rt, ConstArrayView<char> send_buf, ArrayView<char> recv_buf) = 0;
313 virtual Request allReduce(eReduceType rt, ConstArrayView<signed char> send_buf, ArrayView<signed char> recv_buf) = 0;
314 virtual Request allReduce(eReduceType rt, ConstArrayView<unsigned char> send_buf, ArrayView<unsigned char> recv_buf) = 0;
315 virtual Request allReduce(eReduceType rt, ConstArrayView<short> send_buf, ArrayView<short> recv_buf) = 0;
316 virtual Request allReduce(eReduceType rt, ConstArrayView<unsigned short> send_buf, ArrayView<unsigned short> recv_buf) = 0;
317 virtual Request allReduce(eReduceType rt, ConstArrayView<int> send_buf, ArrayView<int> recv_buf) = 0;
318 virtual Request allReduce(eReduceType rt, ConstArrayView<unsigned int> send_buf, ArrayView<unsigned int> recv_buf) = 0;
319 virtual Request allReduce(eReduceType rt, ConstArrayView<long> send_buf, ArrayView<long> recv_buf) = 0;
320 virtual Request allReduce(eReduceType rt, ConstArrayView<unsigned long> send_buf, ArrayView<unsigned long> recv_buf) = 0;
321 virtual Request allReduce(eReduceType rt, ConstArrayView<long long> send_buf, ArrayView<long long> recv_buf) = 0;
322 virtual Request allReduce(eReduceType rt, ConstArrayView<unsigned long long> send_buf, ArrayView<unsigned long long> recv_buf) = 0;
323 virtual Request allReduce(eReduceType rt, ConstArrayView<float> send_buf, ArrayView<float> recv_buf) = 0;
324 virtual Request allReduce(eReduceType rt, ConstArrayView<double> send_buf, ArrayView<double> recv_buf) = 0;
325 virtual Request allReduce(eReduceType rt, ConstArrayView<long double> send_buf, ArrayView<long double> recv_buf) = 0;
326#ifdef ARCANE_REAL_NOT_BUILTIN
327 virtual Request allReduce(eReduceType rt, ConstArrayView<Real> send_buf, ArrayView<Real> recv_buf) = 0;
328#endif
329 virtual Request allReduce(eReduceType rt, ConstArrayView<Real2> send_buf, ArrayView<Real2> recv_buf) = 0;
330 virtual Request allReduce(eReduceType rt, ConstArrayView<Real3> send_buf, ArrayView<Real3> recv_buf) = 0;
331 virtual Request allReduce(eReduceType rt, ConstArrayView<Real2x2> send_buf, ArrayView<Real2x2> recv_buf) = 0;
332 virtual Request allReduce(eReduceType rt, ConstArrayView<Real3x3> send_buf, ArrayView<Real3x3> recv_buf) = 0;
333 virtual Request allReduce(eReduceType rt, ConstArrayView<HPReal> send_buf, ArrayView<HPReal> recv_buf) = 0;
334 //@}
335
336 /*!
337 * @name Broadcast operations
338 *
339 * \brief Sends an array of values to all subdomains.
340 *
341 * This operation sends the value array \a send_buf to all
342 * subdomains. The array used is the one whose rank (commRank) is \a rank.
343 * All participating subdomains must call this method with
344 * the same parameter \a rank and have an array \a send_buf
345 * containing the same number of elements.
346 */
347 //@{
348 virtual Request broadcast(ArrayView<char> send_buf, Integer rank) = 0;
349 virtual Request broadcast(ArrayView<signed char> send_buf, Integer rank) = 0;
350 virtual Request broadcast(ArrayView<unsigned char> send_buf, Integer rank) = 0;
351 virtual Request broadcast(ArrayView<short> send_buf, Integer rank) = 0;
352 virtual Request broadcast(ArrayView<unsigned short> send_buf, Integer rank) = 0;
353 virtual Request broadcast(ArrayView<int> send_buf, Integer rank) = 0;
354 virtual Request broadcast(ArrayView<unsigned int> send_buf, Integer rank) = 0;
355 virtual Request broadcast(ArrayView<long> send_buf, Integer rank) = 0;
356 virtual Request broadcast(ArrayView<unsigned long> send_buf, Integer rank) = 0;
357 virtual Request broadcast(ArrayView<long long> send_buf, Integer rank) = 0;
358 virtual Request broadcast(ArrayView<unsigned long long> send_buf, Integer rank) = 0;
359 virtual Request broadcast(ArrayView<float> send_buf, Integer rank) = 0;
360 virtual Request broadcast(ArrayView<double> send_buf, Integer rank) = 0;
361 virtual Request broadcast(ArrayView<long double> send_buf, Integer rank) = 0;
362#ifdef ARCANE_REAL_NOT_BUILTIN
363 virtual Request broadcast(ArrayView<Real> send_buf, Integer rank) = 0;
364#endif
365 virtual Request broadcast(ArrayView<Real2> send_buf, Integer rank) = 0;
366 virtual Request broadcast(ArrayView<Real3> send_buf, Integer rank) = 0;
367 virtual Request broadcast(ArrayView<Real2x2> send_buf, Integer rank) = 0;
368 virtual Request broadcast(ArrayView<Real3x3> send_buf, Integer rank) = 0;
369 virtual Request broadcast(ArrayView<HPReal> send_buf, Integer rank) = 0;
370 //virtual Request broadcastString(String& str,Integer rank) =0;
371
372 //virtual Request broadcastSerializer(ISerializer* values,Integer rank) =0;
373 /*! \brief Performs a broadcast of a memory region.
374 *
375 * The processor performing the broadcast is given by \id. The array
376 * sent is then given by \a bytes. The receiving processors receive
377 * the array in \a bytes. This array is allocated automatically; receiving
378 * processors do not need to know the number of bytes to be sent.
379 *
380 */
381 //virtual Request broadcastMemoryBuffer(ByteArray& bytes,Integer rank) =0;
382 //@}
383
384 virtual Request allToAll(ConstArrayView<char> send_buf, ArrayView<char> recv_buf,
385 Integer count) = 0;
386 virtual Request allToAll(ConstArrayView<signed char> send_buf, ArrayView<signed char> recv_buf,
387 Integer count) = 0;
388 virtual Request allToAll(ConstArrayView<unsigned char> send_buf, ArrayView<unsigned char> recv_buf,
389 Integer count) = 0;
390 virtual Request allToAll(ConstArrayView<int> send_buf, ArrayView<int> recv_buf, Integer count) = 0;
391 virtual Request allToAll(ConstArrayView<unsigned int> send_buf, ArrayView<unsigned int> recv_buf,
392 Integer count) = 0;
393 virtual Request allToAll(ConstArrayView<short> send_buf, ArrayView<short> recv_buf, Integer count) = 0;
394 virtual Request allToAll(ConstArrayView<unsigned short> send_buf, ArrayView<unsigned short> recv_buf,
395 Integer count) = 0;
396 virtual Request allToAll(ConstArrayView<long> send_buf, ArrayView<long> recv_buf, Integer count) = 0;
397 virtual Request allToAll(ConstArrayView<unsigned long> send_buf, ArrayView<unsigned long> recv_buf,
398 Integer count) = 0;
399 virtual Request allToAll(ConstArrayView<long long> send_buf, ArrayView<long long> recv_buf,
400 Integer count) = 0;
401 virtual Request allToAll(ConstArrayView<unsigned long long> send_buf,
402 ArrayView<unsigned long long> recv_buf, Integer count) = 0;
403 virtual Request allToAll(ConstArrayView<float> send_buf, ArrayView<float> recv_buf,
404 Integer count) = 0;
405 virtual Request allToAll(ConstArrayView<double> send_buf, ArrayView<double> recv_buf,
406 Integer count) = 0;
407 virtual Request allToAll(ConstArrayView<long double> send_buf, ArrayView<long double> recv_buf,
408 Integer count) = 0;
409#ifdef ARCANE_REAL_NOT_BUILTIN
410 virtual Request allToAll(ConstArrayView<Real> send_buf, ArrayView<Real> recv_buf,
411 Integer count) = 0;
412#endif
413 virtual Request allToAll(ConstArrayView<Real2> send_buf, ArrayView<Real2> recv_buf,
414 Integer count) = 0;
415 virtual Request allToAll(ConstArrayView<Real3> send_buf, ArrayView<Real3> recv_buf,
416 Integer count) = 0;
417 virtual Request allToAll(ConstArrayView<Real2x2> send_buf, ArrayView<Real2x2> recv_buf,
418 Integer count) = 0;
419 virtual Request allToAll(ConstArrayView<Real3x3> send_buf, ArrayView<Real3x3> recv_buf,
420 Integer count) = 0;
421 virtual Request allToAll(ConstArrayView<HPReal> send_buf, ArrayView<HPReal> recv_buf,
422 Integer count) = 0;
423
424 /*! @name allToAll variable
425 *
426 * \brief Performs a variable allToAll.
427 *
428 */
429 //@{
430 virtual Request allToAllVariable(ConstArrayView<char> send_buf, Int32ConstArrayView send_count,
431 Int32ConstArrayView send_index, ArrayView<char> recv_buf,
432 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
433 virtual Request allToAllVariable(ConstArrayView<signed char> send_buf, Int32ConstArrayView send_count,
434 Int32ConstArrayView send_index, ArrayView<signed char> recv_buf,
435 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
436 virtual Request allToAllVariable(ConstArrayView<unsigned char> send_buf, Int32ConstArrayView send_count,
438 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
439 virtual Request allToAllVariable(ConstArrayView<int> send_buf, Int32ConstArrayView send_count,
440 Int32ConstArrayView send_index, ArrayView<int> recv_buf,
441 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
442 virtual Request allToAllVariable(ConstArrayView<unsigned int> send_buf, Int32ConstArrayView send_count,
443 Int32ConstArrayView send_index, ArrayView<unsigned int> recv_buf,
444 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
445 virtual Request allToAllVariable(ConstArrayView<short> send_buf, Int32ConstArrayView send_count,
446 Int32ConstArrayView send_index, ArrayView<short> recv_buf,
447 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
448 virtual Request allToAllVariable(ConstArrayView<unsigned short> send_buf, Int32ConstArrayView send_count,
450 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
451 virtual Request allToAllVariable(ConstArrayView<long> send_buf, Int32ConstArrayView send_count,
452 Int32ConstArrayView send_index, ArrayView<long> recv_buf,
453 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
454 virtual Request allToAllVariable(ConstArrayView<unsigned long> send_buf, Int32ConstArrayView send_count,
456 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
457 virtual Request allToAllVariable(ConstArrayView<long long> send_buf, Int32ConstArrayView send_count,
458 Int32ConstArrayView send_index, ArrayView<long long> recv_buf,
459 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
460 virtual Request allToAllVariable(ConstArrayView<unsigned long long> send_buf, Int32ConstArrayView send_count,
462 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
463 virtual Request allToAllVariable(ConstArrayView<float> send_buf, Int32ConstArrayView send_count,
464 Int32ConstArrayView send_index, ArrayView<float> recv_buf,
465 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
466 virtual Request allToAllVariable(ConstArrayView<double> send_buf, Int32ConstArrayView send_count,
467 Int32ConstArrayView send_index, ArrayView<double> recv_buf,
468 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
469 virtual Request allToAllVariable(ConstArrayView<long double> send_buf, Int32ConstArrayView send_count,
470 Int32ConstArrayView send_index, ArrayView<long double> recv_buf,
471 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
472#ifdef ARCANE_REAL_NOT_BUILTIN
473 virtual Request allToAllVariable(ConstArrayView<Real> send_buf, Int32ConstArrayView send_count,
474 Int32ConstArrayView send_index, ArrayView<Real> recv_buf,
475 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
476#endif
477 virtual Request allToAllVariable(ConstArrayView<Real2> send_buf, Int32ConstArrayView send_count,
478 Int32ConstArrayView send_index, ArrayView<Real2> recv_buf,
479 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
480 virtual Request allToAllVariable(ConstArrayView<Real3> send_buf, Int32ConstArrayView send_count,
481 Int32ConstArrayView send_index, ArrayView<Real3> recv_buf,
482 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
483 virtual Request allToAllVariable(ConstArrayView<Real2x2> send_buf, Int32ConstArrayView send_count,
484 Int32ConstArrayView send_index, ArrayView<Real2x2> recv_buf,
485 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
486 virtual Request allToAllVariable(ConstArrayView<Real3x3> send_buf, Int32ConstArrayView send_count,
487 Int32ConstArrayView send_index, ArrayView<Real3x3> recv_buf,
488 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
489 virtual Request allToAllVariable(ConstArrayView<HPReal> send_buf, Int32ConstArrayView send_count,
490 Int32ConstArrayView send_index, ArrayView<HPReal> recv_buf,
491 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
492 //@}
493
494 //! @name Synchronization and asynchronous operations
495 //@{
496 //! Performs a barrier
497 virtual Request barrier() = 0;
498 //@}
499
500 /*!
501 * \brief Indicates if the implementation allows reductions on derived types.
502 *
503 * OpenMPI versions up to and including 1.8.4 seem to have a bug (which results in a crash)
504 * with non-blocking reductions when the reduction operator is redefined. This is the case with
505 * derived types such as Real3, Real2, ...
506 */
507 virtual bool hasValidReduceForDerivedType() const = 0;
508};
509
510/*---------------------------------------------------------------------------*/
511/*---------------------------------------------------------------------------*/
512
513} // namespace Arcane
514
515/*---------------------------------------------------------------------------*/
516/*---------------------------------------------------------------------------*/
517
518#endif
File containing declarations concerning the message passing model.
Declarations of types used in Arcane.
Modifiable view of an array of type T.
Base class for 1D data vectors.
Constant view of an array of type T.
Interface of the parallelism manager for a subdomain.
Interface for non-blocking collective parallel operations.
virtual Request barrier()=0
Performs a barrier.
virtual ~IParallelNonBlockingCollective()=default
Releases resources.
virtual void build()=0
Constructs the instance.
virtual Request allGather(ConstArrayView< char > send_buf, ArrayView< char > recv_buf)=0
Performs a gather on all processors. This is a collective operation. The array send_buf must have the...
virtual bool hasValidReduceForDerivedType() const =0
Indicates if the implementation allows reductions on derived types.
virtual IParallelMng * parallelMng() const =0
Associated parallelism manager.
virtual Request allReduce(eReduceType rt, ConstArrayView< char > send_buf, ArrayView< char > recv_buf)=0
Performs the reduction of type rt on the array send_buf and stores the result in recv_buf.
virtual Request gather(ConstArrayView< char > send_buf, ArrayView< char > recv_buf, Integer rank)=0
Performs a gather on one processor. This is a collective operation. The array send_buf must have the ...
virtual Request allToAll(ConstArrayView< char > send_buf, ArrayView< char > recv_buf, Integer count)=0
Performs a broadcast of a memory region.
eReduceType
Supported reduction types.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482