Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MpiSerializeDispatcher.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/* MpiSerializeDispatcher.h (C) 2000-2020 */
9/* */
10/* Gestion des messages de sérialisation avec MPI. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSINGMPI_MPISERIALIZEDISPATCHER_H
13#define ARCCORE_MESSAGEPASSINGMPI_MPISERIALIZEDISPATCHER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
18#include "arccore/message_passing/ISerializeDispatcher.h"
19#include "arccore/message_passing/Request.h"
20#include "arccore/collections/Array.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arccore
27{
28class ISerializer;
29class BasicSerializer;
30class ITraceMng;
31}
32
33namespace Arccore::MessagePassing::Mpi
34{
35class ARCCORE_MESSAGEPASSINGMPI_EXPORT MpiSerializeDispatcher
37{
41
42 public:
43
45 {
46 public:
47 static const int MAX_REQUEST_SIZE = 256;
48 public:
49 public:
50 Byte m_bytes[MAX_REQUEST_SIZE];
51 Request m_request;
52 };
53
54 public:
55
57 ~MpiSerializeDispatcher() override;
58
59 public:
60
61 Ref<ISerializeMessageList> createSerializeMessageListRef() override;
62 Request sendSerializer(const ISerializer* s,const PointToPointMessageInfo& message) override;
63 Request receiveSerializer(ISerializer* s,const PointToPointMessageInfo& message) override;
64
65 public:
66
67 // Ces méthodes sont spécifiques à la version MPI.
68 //!@{
69 Int64 serializeBufferSize() const { return m_serialize_buffer_size; }
70 Request legacySendSerializer(ISerializer* values,const PointToPointMessageInfo& message);
71 Request sendSerializer(const ISerializer* s,const PointToPointMessageInfo& message,bool force_one_message);
72 void legacyReceiveSerializer(ISerializer* values,MessageRank rank,MessageTag mpi_tag);
73 void checkFinishedSubRequests();
74 MpiAdapter* adapter() const { return m_adapter; }
75 static MessageTag nextSerializeTag(MessageTag tag);
76 //!@}
77
78 void broadcastSerializer(ISerializer* values,MessageRank rank);
79 ITraceMng* traceMng() const { return m_trace; }
80
81 protected:
82
83 // Ceux deux méthodes sont utilisés aussi par 'MpiSerializeMessageList'
84 Request _recvSerializerBytes(Span<Byte> bytes,MessageRank rank,MessageTag tag,bool is_blocking);
85 Request _recvSerializerBytes(Span<Byte> bytes,MessageId message_id,bool is_blocking);
86
87 private:
88
89 MpiAdapter* m_adapter = nullptr;
90 ITraceMng* m_trace = nullptr;
91 Int64 m_serialize_buffer_size;
92 Int64 m_max_serialize_buffer_size;
94 bool m_is_trace_serializer = false;
95 MPI_Datatype m_byte_serializer_datatype;
96
97 private:
98
99 BasicSerializer* _castSerializer(ISerializer* serializer);
100 const BasicSerializer* _castSerializer(const ISerializer* serializer);
101 void _checkBigMessage(Int64 message_size);
102 Request _sendSerializerWithTag(ISerializer* values,MessageRank rank,
103 MessageTag mpi_tag,bool is_blocking);
104 Request _sendSerializerBytes(Span<const Byte> bytes,MessageRank rank,
105 MessageTag tag,bool is_blocking);
106 void _init();
107};
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112} // namespace Arccore::MessagePassing::Mpi
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
116
117#endif
Déclarations des types de la composante 'base' de Arccore.
Interface du gestionnaire de traces.
Interface des messages de sérialisation.
Implémentation MPI de la gestion des 'ISerializeMessage'.
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
Vecteur 1D de données avec sémantique par valeur (style STL).
Espace de nom de Arccore.
Definition ArcaneTypes.h:24
std::int64_t Int64
Type entier signé sur 64 bits.
unsigned char Byte
Type d'un octet.
Definition BaseTypes.h:43