Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MpiTypeDispatcher.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* MpiTypeDispatcher.h (C) 2000-2024 */
9/* */
10/* Gestion des messages pour un type de données. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSINGMPI_MPITYPEDISPATCHER_H
13#define ARCCORE_MESSAGEPASSINGMPI_MPITYPEDISPATCHER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
18#include "arccore/message_passing/ITypeDispatcher.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arccore::MessagePassing::Mpi
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29template <typename Type>
31: public ITypeDispatcher<Type>
32{
33 public:
34
35 MpiTypeDispatcher(IMessagePassingMng* parallel_mng, MpiAdapter* adapter, MpiDatatype* datatype);
37
38 public:
39
40 void finalize() override {}
41 void broadcast(Span<Type> send_buf, Int32 rank) override;
42 void allGather(Span<const Type> send_buf,Span<Type> recv_buf) override;
43 void allGatherVariable(Span<const Type> send_buf,Array<Type>& recv_buf) override;
44 void gather(Span<const Type> send_buf,Span<Type> recv_buf,Int32 rank) override;
45 void gatherVariable(Span<const Type> send_buf,Array<Type>& recv_buf,Int32 rank) override;
46 void scatterVariable(Span<const Type> send_buf,Span<Type> recv_buf,Int32 root) override;
47 void allToAll(Span<const Type> send_buf,Span<Type> recv_buf,Int32 count) override;
48 void allToAllVariable(Span<const Type> send_buf,Int32ConstArrayView send_count,
49 Int32ConstArrayView send_index,Span<Type> recv_buf,
50 Int32ConstArrayView recv_count,Int32ConstArrayView recv_index) override;
51 Request send(Span<const Type> send_buffer,Int32 rank,bool is_blocked) override;
52 Request send(Span<const Type> send_buffer,const PointToPointMessageInfo& message) override;
53 Request receive(Span<Type> recv_buffer,Int32 rank,bool is_blocked) override;
54 Request receive(Span<Type> recv_buffer,const PointToPointMessageInfo& message) override;
55 Type allReduce(eReduceType op,Type send_buf) override;
56 void allReduce(eReduceType op,Span<Type> send_buf) override;
57 Request nonBlockingAllReduce(eReduceType op, Span<const Type> send_buf, Span<Type> recv_buf) override;
58 Request nonBlockingAllGather(Span<const Type> send_buf, Span<Type> recv_buf) override;
59 Request nonBlockingBroadcast(Span<Type> send_buf, Int32 rank) override;
60 Request nonBlockingGather(Span<const Type> send_buf, Span<Type> recv_buf, Int32 rank) override;
61 Request nonBlockingAllToAll(Span<const Type> send_buf, Span<Type> recv_buf, Int32 count) override;
62 Request nonBlockingAllToAllVariable(Span<const Type> send_buf, ConstArrayView<Int32> send_count,
63 ConstArrayView<Int32> send_index, Span<Type> recv_buf,
64 ConstArrayView<Int32> recv_count, ConstArrayView<Int32> recv_index) override;
65 Request gather(GatherMessageInfo<Type>& gather_info) override;
66 void gatherVariable(Span<const Type> send_buf,Span<Type> recv_buf,Span<const Int32> displacements,
67 Span<const Int32> counts,Int32 rank);
68
69 public:
70
71 MpiDatatype* datatype() const { return m_datatype; }
72 IMessagePassingMng* messagePassingMng() const { return m_parallel_mng; }
73 MpiAdapter* adapter() const { return m_adapter; }
74 void setDestroyDatatype(bool v) { m_is_destroy_datatype = v; }
75 bool isDestroyDatatype() const { return m_is_destroy_datatype; }
76
77 private:
78
79 IMessagePassingMng* m_parallel_mng;
80 MpiAdapter* m_adapter;
81 MpiDatatype* m_datatype;
82 bool m_is_destroy_datatype = false;
83
84 private:
85
86 void _gatherVariable2(Span<const Type> send_buf, Array<Type>& recv_buf, Integer rank);
87};
88
89/*---------------------------------------------------------------------------*/
90/*---------------------------------------------------------------------------*/
91
92} // End namespace Arccore::MessagePassing::Mpi
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
97#endif
98
Classe de base des vecteurs 1D de données.
Informations pour un message 'gather' pour le type de données DataType.
Interface du gestionnaire des échanges de messages.
Informations pour envoyer/recevoir un message point à point.
Requête d'un message.
Definition Request.h:77
Vue d'un tableau d'éléments de type T.
Definition Span.h:510
eReduceType
Types des réductions supportées.
Int32 Integer
Type représentant un entier.
std::int32_t Int32
Type entier signé sur 32 bits.