Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ItemsExchangeInfo2.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/* ItemsExchangeInfo2.h (C) 2000-2024 */
9/* */
10/* Information for exchanging entities and their characteristics. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_ITEMSEXCHANGEINFO2_H
13#define ARCANE_MESH_ITEMSEXCHANGEINFO2_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/List.h"
18#include "arcane/utils/TraceAccessor.h"
19
20#include "arcane/core/VariableCollection.h"
21#include "arcane/core/IItemFamilyExchanger.h"
22#include "arcane/core/IItemFamilySerializeStep.h"
23#include "arcane/core/ParallelExchangerOptions.h"
24
25#include "arcane/mesh/MeshGlobal.h"
26
27#include <set>
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32namespace Arcane
33{
34class ItemInternal;
38} // namespace Arcane
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
43namespace Arcane::mesh
44{
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
74class ARCANE_MESH_EXPORT ItemsExchangeInfo2
75: public TraceAccessor
77{
78 public:
79
80 ItemsExchangeInfo2(IItemFamily* item_family);
81 ~ItemsExchangeInfo2();
82
83 public:
84
85 void computeExchangeItems() override;
86
87 void setExchangeItems(ConstArrayView<std::set<Int32>> items_to_send) override;
88
94 bool computeExchangeInfos() override;
95
97 void prepareToSend() override;
98 void releaseBuffer() override;
99
110 void readAndAllocItems() override;
111 void readAndAllocSubMeshItems() override;
112 void readAndAllocItemRelations() override;
113
115 void readGroups() override;
116
118 void readVariables() override;
119
130 void removeSentItems() override;
131
133 void processExchange() override;
134
142 void finalizeExchange() override;
143
144 IItemFamily* itemFamily() override { return m_item_family; }
145
146 void setParallelExchangerOption(const ParallelExchangerOptions& options) override;
147
148 public:
149
150 void addSerializeStep(IItemFamilySerializeStep* step);
151
152 private:
153
154 IItemFamily* m_item_family;
155
158
161
169
170 Ref<IParallelExchanger> m_exchanger;
171
176
177 IItemFamilySerializer* m_family_serializer;
178
180
181 ParallelExchangerOptions m_exchanger_option;
182
183 private:
184
185 inline void _addItemToSend(Int32 sub_domain_id, Item item);
186 bool _computeExchangeInfos();
187 void _applySerializeStep(IItemFamilySerializeStep::ePhase phase,
188 const ItemFamilySerializeArgs& args);
189 void _applyDeserializePhase(IItemFamilySerializeStep::ePhase phase);
190};
191
192/*---------------------------------------------------------------------------*/
193/*---------------------------------------------------------------------------*/
194
195} // namespace Arcane::mesh
196
197/*---------------------------------------------------------------------------*/
198/*---------------------------------------------------------------------------*/
199
200#endif
Constant view of an array of type T.
Exchange of entities and their characteristics for a given family.
Interface for a step in the serialization of entity families.
Manages the serialization/deserialization of entities in a family.
Interface of an entity family.
Definition IItemFamily.h:83
Information exchange between processors.
Arguments for the serialization callbacks of entity families.
Internal structure of a mesh entity.
Base class for a mesh element.
Definition Item.h:84
Options for IParallelMng::processExchange().
Reference to an instance.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
Manages the serialization/deserialization of variables within a family.
Serializes the entities of the groups.
UniqueArray< ItemGroupsSerializer2 * > m_groups_serializers
Serializer of groups.
void readAndAllocItems() override
After receiving messages, reads and creates the transferred entities.
void readVariables() override
After receiving messages, reads the variable values.
void removeSentItems() override
Deletes the sent entities.
void finalizeExchange() override
Finalizes the exchange.
UniqueArray< SharedArray< Int32 > > m_receive_local_ids
List of local IDs of received entities.
void computeExchangeItems() override
Determines the list of entities to exchange.
UniqueArray< IItemFamily * > m_families_to_exchange
List of families included in the exchange.
void setExchangeItems(ConstArrayView< std::set< Int32 > > items_to_send) override
Positions the list of entities to exchange.
void processExchange() override
Sends the exchange messages.
bool computeExchangeInfos() override
Determines the necessary information for the exchanges.
IItemFamily * itemFamily() override
Associated family.
void prepareToSend() override
Prepares the sending structures.
void readGroups() override
After receiving messages, reads the groups.
UniqueArray< SharedArray< Int32 > > m_send_local_ids
List of entities to send to each processor.
Exchanger between sub-domains of linked interfaces.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.