Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshMaterialVariableSynchronizerList.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/* MeshMaterialVariableSynchronizerList.h (C) 2000-2023 */
9/* */
10/* List of variables to synchronize. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_MESHMATERIALVARIABLESYNCHRONIZERLIST_H
13#define ARCANE_MATERIALS_MESHMATERIALVARIABLESYNCHRONIZERLIST_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Array.h"
19
20#include "arcane/materials/MatVarIndex.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane::Materials
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31/*!
32 * \brief Synchronizing a list of material variables.
33 *
34 * The add() method allows adding variables to synchronize.
35 * You must then call apply() to perform the synchronization.
36 *
37 * An instance of this class can be used multiple times.
38 */
39class ARCANE_MATERIALS_EXPORT MeshMaterialVariableSynchronizerList
40{
41 private:
42
43 class Impl;
44 class SyncInfo;
45
46 public:
47
48 explicit MeshMaterialVariableSynchronizerList(IMeshMaterialMng* material_mng);
49 ~MeshMaterialVariableSynchronizerList();
50
51 public:
52
53 MeshMaterialVariableSynchronizerList(const MeshMaterialVariableSynchronizerList&) = delete;
54 MeshMaterialVariableSynchronizerList& operator=(const MeshMaterialVariableSynchronizerList&) = delete;
55 MeshMaterialVariableSynchronizerList(const MeshMaterialVariableSynchronizerList&&) = delete;
56 MeshMaterialVariableSynchronizerList& operator=(const MeshMaterialVariableSynchronizerList&&) = delete;
57
58 public:
59
60 //! Performs the synchronization
61 void apply();
62
63 //! Adds the variable \a var to the list of variables to synchronize
64 void add(MeshMaterialVariable* var);
65
66 //! After calling apply(), contains the size of the messages sent
67 Int64 totalMessageSize() const;
68
69 /*!
70 * \brief Starts a non-blocking synchronization.
71 *
72 * This is only valid if IMeshMaterialMng::synchronizeVariableVersion() equals 7.
73 */
74 void beginSynchronize();
75
76 /*!
77 * \brief Blocks until the ongoing synchronization is finished.
78 *
79 * You must call beginSynchronize() before this call.
80 */
81 void endSynchronize();
82
83 private:
84
85 Impl* m_p;
86
87 private:
88
89 static void _beginSynchronizeMultiple(SyncInfo& sync_info);
90 static void _beginSynchronizeMultiple2(SyncInfo& sync_info);
91 static void _endSynchronizeMultiple2(SyncInfo& sync_info);
92 void _fillSyncInfo(SyncInfo& sync_info);
93 void _beginSynchronize(bool is_blocking);
94 void _endSynchronize(bool is_blocking);
95};
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100} // End namespace Arcane::Materials
101
102/*---------------------------------------------------------------------------*/
103/*---------------------------------------------------------------------------*/
104
105#endif
Interface for the material and environment manager of a mesh.
Int64 totalMessageSize() const
After calling apply(), contains the size of the messages sent.
void add(MeshMaterialVariable *var)
Adds the variable var to the list of variables to synchronize.
void endSynchronize()
Blocks until the ongoing synchronization is finished.
Always enables tracing in Arcane parts concerning materials.
class ARCANE_MATERIALS_EXPORT(64) SimdMatVarIndex
SIMD indexer on a component.
std::int64_t Int64
Signed integer type of 64 bits.