Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
VariableParallelOperationBase.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/* VariableParallelOperationBase.h (C) 2000-2025 */
9/* */
10/* Base class for parallel operations on variables. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_PARALLEL_VARIABLEPARALLELOPERATION_H
13#define ARCANE_CORE_PARALLEL_VARIABLEPARALLELOPERATION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/List.h"
18#include "arcane/utils/Array.h"
19#include "arcane/utils/TraceAccessor.h"
20
23#include "arcane/core/VariableCollection.h"
24
25#include "arcane/core/IVariableParallelOperation.h"
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30namespace Arcane::Parallel
31{
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36/*!
37 * \brief Interface for a class of parallel operations on variables.
38 *
39 These operations are collective.
40 */
41class ARCANE_CORE_EXPORT VariableParallelOperationBase
42: public TraceAccessor
44{
45 public:
46
47 VariableParallelOperationBase(IParallelMng* pm);
48 virtual ~VariableParallelOperationBase() {} //!< Frees resources.
49
50 public:
51
52 void build() override {}
53
54 public:
55
56 void setItemFamily(IItemFamily* family) override;
57 IItemFamily* itemFamily() override;
58 void addVariable(IVariable* variable) override;
59 void applyOperation(IDataOperation* operation) override;
60
61 protected:
62
63 Array<SharedArray<ItemLocalId>>& _itemsToSend() { return m_items_to_send; }
64
65 virtual void _buildItemsToSend() = 0;
66
67 private:
68
69 IParallelMng* m_parallel_mng;
70 IItemFamily* m_item_family;
71 VariableList m_variables;
72 //! List of entities to send to each processor
74};
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79} // namespace Arcane::Parallel
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84#endif
Declarations of Arcane's general types.
File containing declarations concerning the message passing model.
Base class for 1D data vectors.
Interface of an entity family.
Definition IItemFamily.h:83
Interface of the parallelism manager for a subdomain.
Interface of a variable.
Definition IVariable.h:40
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
Concurrency implementation.