Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ParallelSuperMngDispatcher.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/* ParallelSuperMngDispatcher.h (C) 2000-2025 */
9/* */
10/* Interface for the parallelism manager on a domain. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_PARALLELSUPERMNGDISPATCHER_H
13#define ARCANE_CORE_PARALLELSUPERMNGDISPATCHER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IParallelSuperMng.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24template <class T> class IParallelDispatchT;
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
34class ARCANE_CORE_EXPORT ParallelSuperMngDispatcher
35: public IParallelSuperMng
36{
37 public:
38
39 ParallelSuperMngDispatcher();
40 ~ParallelSuperMngDispatcher() override;
41
42 protected:
43
44 void _setDispatchers(IParallelDispatchT<Byte>* b, IParallelDispatchT<Int32>* i32,
46 void _finalize();
47
48 public:
49
50 virtual void allGather(ByteConstArrayView send_buf, ByteArrayView recv_buf);
51 virtual void allGather(Int32ConstArrayView send_buf, Int32ArrayView recv_buf);
52 virtual void allGather(Int64ConstArrayView send_buf, Int64ArrayView recv_buf);
53 virtual void allGather(RealConstArrayView send_buf, RealArrayView recv_buf);
54
55 virtual Int32 reduce(eReduceType rt, Int32 v);
56 virtual Int64 reduce(eReduceType rt, Int64 v);
57 virtual Real reduce(eReduceType rt, Real v);
58
59 virtual void reduce(eReduceType rt, Int32ArrayView v);
60 virtual void reduce(eReduceType rt, Int64ArrayView v);
61 virtual void reduce(eReduceType rt, RealArrayView v);
62
63 void broadcast(ByteArrayView send_buf, Integer id) override;
64 void broadcast(Int32ArrayView send_buf, Integer id) override;
65 void broadcast(Int64ArrayView send_buf, Integer id) override;
66 void broadcast(RealArrayView send_buf, Integer id) override;
67
68 virtual void send(ByteConstArrayView values, Integer id);
69 virtual void send(Int32ConstArrayView values, Integer id);
70 virtual void send(Int64ConstArrayView values, Integer id);
71 virtual void send(RealConstArrayView values, Integer id);
72
73 virtual void recv(ByteArrayView values, Integer id);
74 virtual void recv(Int32ArrayView values, Integer id);
75 virtual void recv(Int64ArrayView values, Integer id);
76 virtual void recv(RealArrayView values, Integer id);
77
78 virtual Request send(ByteConstArrayView values, Integer id, bool is_blocked);
79 virtual Request send(Int32ConstArrayView values, Integer id, bool is_blocked);
80 virtual Request send(Int64ConstArrayView values, Integer id, bool is_blocked);
81 virtual Request send(RealConstArrayView values, Integer id, bool is_blocked);
82
83 virtual Request recv(ByteArrayView values, Integer id, bool is_blocked);
84 virtual Request recv(Int32ArrayView values, Integer id, bool is_blocked);
85 virtual Request recv(Int64ArrayView values, Integer id, bool is_blocked);
86 virtual Request recv(RealArrayView values, Integer id, bool is_blocked);
87
88 virtual void sendRecv(ByteConstArrayView send_buf, ByteArrayView recv_buf, Integer id);
89 virtual void sendRecv(Int32ConstArrayView send_buf, Int32ArrayView recv_buf, Integer id);
90 virtual void sendRecv(Int64ConstArrayView send_buf, Int64ArrayView recv_buf, Integer id);
91 virtual void sendRecv(RealConstArrayView send_buf, RealArrayView recv_buf, Integer id);
92
93 virtual void allToAll(ByteConstArrayView send_buf, ByteArrayView recv_buf, Integer count);
94 virtual void allToAll(Int32ConstArrayView send_buf, Int32ArrayView recv_buf, Integer count);
95 virtual void allToAll(Int64ConstArrayView send_buf, Int64ArrayView recv_buf, Integer count);
96 virtual void allToAll(RealConstArrayView send_buf, RealArrayView recv_buf, Integer count);
97
98 virtual Int32 scan(eReduceType rt, Int32 v);
99 virtual Int64 scan(eReduceType rt, Int64 v);
100 virtual Real scan(eReduceType rt, Real v);
101
102 virtual void scan(eReduceType rt, Int32ArrayView v);
103 virtual void scan(eReduceType rt, Int64ArrayView v);
104 virtual void scan(eReduceType rt, RealArrayView v);
105
106 private:
107
108 IParallelDispatchT<Byte>* m_byte = nullptr;
109 IParallelDispatchT<Int32>* m_int32 = nullptr;
110 IParallelDispatchT<Int64>* m_int64 = nullptr;
111 IParallelDispatchT<Real>* m_real = nullptr;
112};
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
116
117} // namespace Arcane
118
119/*---------------------------------------------------------------------------*/
120/*---------------------------------------------------------------------------*/
121
122#endif
Parallel message handling for the type Type.
Abstract class of the parallelism supervisor.
void broadcast(ByteArrayView send_buf, Integer id) override
Sends an array of values to all processes This operation synchronizes the value array send_buf across...
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:451
ArrayView< Byte > ByteArrayView
C equivalent of a 1D array of characters.
Definition UtilsTypes.h:447
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:453
double Real
Type representing a real number.
ConstArrayView< Byte > ByteConstArrayView
C equivalent of a 1D array of characters.
Definition UtilsTypes.h:476
ArrayView< Real > RealArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:459
std::int32_t Int32
Signed integer type of 32 bits.
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:488