Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
LoadBalanceMng.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/* LoadBalanceMng.h (C) 2000-2024 */
9/* */
10/* Manager for partitioning and load balancing. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_IMPL_LOADBALANCEMNG_H
13#define ARCANE_IMPL_LOADBALANCEMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/ILoadBalanceMng.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
33class ARCANE_IMPL_EXPORT LoadBalanceMng
34: public ILoadBalanceMng
35{
36 public:
37
38 explicit LoadBalanceMng(ISubDomain* sd);
39 LoadBalanceMng(ISubDomain* sd, bool mass_as_criterion);
40
41 public:
42
46 void addMass(VariableCellInt32& count, const String& entity = "") override;
47 void addCriterion(VariableCellInt32& count) override;
48 void addCriterion(VariableCellReal& count) override;
49 void addCommCost(VariableFaceInt32& count, const String& entity = "") override;
50
51 void reset() override;
52
56 void setMassAsCriterion(bool active = true) override;
57 void setNbCellsAsCriterion(bool active = true) override;
58 void setCellCommContrib(bool active = true) override;
59 bool cellCommContrib() const override;
60 void setComputeComm(bool active = true) override;
61 Integer nbCriteria() override;
62 void initAccess(IMesh* mesh = nullptr) override;
63 const VariableFaceReal& commCost() const override;
64 const VariableCellReal& massWeight() const override;
65 const VariableCellReal& massResWeight() const override;
66 const VariableCellArrayReal& mCriteriaWeight() const override;
67 void endAccess() override;
68 void notifyEndPartition() override;
69
71
72 private:
73
75 MeshHandle m_mesh_handle;
76
77 private:
78
79 void _init(bool use_mass_as_criterion, bool is_legacy_init);
80 static bool _isLegacyInit();
81};
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86} // End namespace Arcane
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91#endif
Internal API of ILoadBalanceMng to Arcane.
Interface for registering variables for load balancing.
Interface of the subdomain manager.
Definition ISubDomain.h:75
void addMass(VariableCellInt32 &count, const String &entity="") override
void setMassAsCriterion(bool active=true) override
ILoadBalanceMngInternal * _internalApi() override
Internal API for Arcane.
Handle on a mesh.
Definition MeshHandle.h:48
Reference to an instance.
MeshVariableScalarRefT< Face, Real > VariableFaceReal
Real type quantity at face.
MeshVariableScalarRefT< Cell, Real > VariableCellReal
Real type quantity at cell center.
MeshVariableArrayRefT< Cell, Real > VariableCellArrayReal
Quantity at the cell center of real array type.
MeshVariableScalarRefT< Cell, Int32 > VariableCellInt32
Quantity at the cell center of 32-bit integer type.
MeshVariableScalarRefT< Face, Int32 > VariableFaceInt32
Quantity at the face of 32-bit integer type.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.