Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MeshMaterialVariableSynchronizer.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/* MeshMaterialVariableSynchronizer.h (C) 2000-2025 */
9/* */
10/* Material variable synchronizer. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_INTERNAL_MESHMATERIALVARIABLESYNCHRONIZER_H
13#define ARCANE_MATERIALS_INTERNAL_MESHMATERIALVARIABLESYNCHRONIZER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Array.h"
19#include "arcane/utils/Ref.h"
20
21#include "arcane/materials/MatVarIndex.h"
22#include "arcane/materials/IMeshMaterialVariableSynchronizer.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::Materials
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
42class ARCANE_MATERIALS_EXPORT MeshMaterialVariableSynchronizer
43: public TraceAccessor
45{
46 public:
47
48 MeshMaterialVariableSynchronizer(IMeshMaterialMng* material_mng,
49 IVariableSynchronizer* var_syncer,
50 MatVarSpace mvs);
51
52 public:
53
57 void recompute() override;
58 void checkRecompute() override;
59 Ref<IMeshMaterialSynchronizeBuffer> commonBuffer() override { return m_common_buffer; }
60 eMemoryRessource bufferMemoryRessource() const override { return m_buffer_memory_ressource; }
61
62 private:
63
64 IMeshMaterialMng* m_material_mng;
65 IVariableSynchronizer* m_variable_synchronizer;
68 Int64 m_timestamp;
69 MatVarSpace m_var_space;
71 eMemoryRessource m_buffer_memory_ressource = eMemoryRessource::UnifiedMemory;
72 // Allows forcing the use or non-use of the accelerator implementation
73 Int32 m_use_accelerator_mode = -1;
74
75 public:
76
77 // Must be public for CUDA.
78 void _fillCellsAccelerator(Array<MatVarIndex>& items, AllEnvCellVectorView view, RunQueue& queue);
79
80 private:
81
82 void _fillCells(Array<MatVarIndex>& items, AllEnvCellVectorView view, RunQueue& queue);
83 void _fillCellsSequential(Array<MatVarIndex>& items, AllEnvCellVectorView view);
84 void _initialize();
85};
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // End namespace Arcane::Materials
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
95#endif
Base class for 1D data vectors.
Constant view of an array of type T.
Interface of a variable synchronization service.
View over a list of cells with environment information.
Interface for the material and environment manager of a mesh.
Ref< IMeshMaterialSynchronizeBuffer > commonBuffer() override
Common buffer for messages.
eMemoryRessource bufferMemoryRessource() const override
Memory resource to use for communication buffers.
IVariableSynchronizer * variableSynchronizer() override
Associated classical variable synchronizer.
void checkRecompute() override
Recalculates synchronization information if necessary.
void recompute() override
Recalculates synchronization information.
ConstArrayView< MatVarIndex > ghostItems(Int32 index) override
List of ghost MatVarIndex for index rank index in the variableSynchronizer::communicatingRanks() arra...
ConstArrayView< MatVarIndex > sharedItems(Int32 index) override
List of shared MatVarIndex for index rank index in the variableSynchronizer::communicatingRanks() arr...
Reference to an instance.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
Always enables tracing in Arcane parts concerning materials.
MatVarSpace
Definition space for a material variable.
class ARCANE_MATERIALS_EXPORT(64) SimdMatVarIndex
SIMD indexer on a component.
std::int64_t Int64
Signed integer type of 64 bits.
Arcane::eMemoryResource eMemoryRessource
Typedef for the historical Arcane version (with 2's').
std::int32_t Int32
Signed integer type of 32 bits.