Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IParallelDispatch.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/* IParallelDispatch.h (C) 2000-2025 */
9/* */
10/* Parallel message handling for a value type. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IPARALLELDISPATCH_H
13#define ARCANE_CORE_IPARALLELDISPATCH_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19#include "arccore/message_passing/ITypeDispatcher.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*!
31 * \internal
32 * \brief Parallel message handling for the type \a Type.
33 */
34template <class Type>
36{
37 public:
38
39 using Request = Parallel::Request;
40 using eReduceType = Parallel::eReduceType;
41 using PointToPointMessageInfo = Parallel::PointToPointMessageInfo;
42
43 public:
44
45 virtual ~IParallelDispatchT() = default;
46
47 public:
48
49 virtual void finalize() = 0;
50
51 public:
52
53 virtual void broadcast(ArrayView<Type> send_buf, Int32 rank) = 0;
54 virtual void allGather(ConstArrayView<Type> send_buf, ArrayView<Type> recv_buf) = 0;
55 virtual void allGatherVariable(ConstArrayView<Type> send_buf, Array<Type>& recv_buf) = 0;
56 virtual void gather(ConstArrayView<Type> send_buf, ArrayView<Type> recv_buf, Int32 rank) = 0;
57 virtual void gatherVariable(ConstArrayView<Type> send_buf, Array<Type>& recv_buf, Int32 rank) = 0;
58 virtual void scatterVariable(ConstArrayView<Type> send_buf, ArrayView<Type> recv_buf, Int32 root) = 0;
59 virtual void allToAll(ConstArrayView<Type> send_buf, ArrayView<Type> recv_buf, Integer count) = 0;
60 virtual void allToAllVariable(ConstArrayView<Type> send_buf, Int32ConstArrayView send_count,
61 Int32ConstArrayView send_index, ArrayView<Type> recv_buf,
62 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) = 0;
63 virtual Type allReduce(eReduceType op, Type send_buf) = 0;
64 virtual void allReduce(eReduceType op, ArrayView<Type> send_buf) = 0;
65
66 public:
67
68 virtual Request send(ConstArrayView<Type> send_buffer, Int32 rank, bool is_blocked) = 0;
69 virtual Request send(Span<const Type> recv_buffer, const PointToPointMessageInfo& message) = 0;
70 virtual Request recv(ArrayView<Type> recv_buffer, Int32 rank, bool is_blocked) = 0;
71 virtual Request receive(Span<Type> recv_buffer, const PointToPointMessageInfo& message) = 0;
72 virtual void send(ConstArrayView<Type> send_buffer, Int32 rank) = 0;
73 virtual void recv(ArrayView<Type> recv_buffer, Int32 rank) = 0;
74 virtual void sendRecv(ConstArrayView<Type> send_buffer, ArrayView<Type> recv_buffer, Int32 proc) = 0;
75 virtual Type scan(eReduceType op, Type send_buf) = 0;
76 virtual void scan(eReduceType op, ArrayView<Type> send_buf) = 0;
77 virtual void computeMinMaxSum(Type val, Type& min_val, Type& max_val, Type& sum_val,
78 Int32& min_rank,
79 Int32& max_rank) = 0;
80 virtual void computeMinMaxSum(ConstArrayView<Type> values,
81 ArrayView<Type> min_values,
82 ArrayView<Type> max_values,
83 ArrayView<Type> sum_values,
84 ArrayView<Int32> min_ranks,
85 ArrayView<Int32> max_ranks) = 0;
86
87 public:
88
89 virtual ITypeDispatcher<Type>* toArccoreDispatcher() = 0;
90};
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
95} // namespace Arcane
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100#endif
Declarations of Arcane's general types.
File containing declarations concerning the message passing model.
Modifiable view of an array of type T.
Base class for 1D data vectors.
Constant view of an array of type T.
Information for sending/receiving a point-to-point message.
View of an array of elements of type T.
Definition Span.h:635
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
std::int32_t Int32
Signed integer type of 32 bits.