Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
VectorDistribution.h
Go to the documentation of this file.
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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
12
13#pragma once
14
15#include <arccore/message_passing/MessagePassingGlobal.h>
16#include "alien/data/ISpace.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Alien
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
33class ALIEN_EXPORT VectorDistribution
34{
35 public:
38
45 const ISpace& space, Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
46
53 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> parallel_mng);
54
60 VectorDistribution(Arccore::Integer global_size,
61 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
62
68 // FIXME: not implemented !
69 VectorDistribution(Arccore::Integer global_size,
70 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> parallel_mng);
71
78 VectorDistribution(const ISpace& space, Arccore::Integer local_size,
79 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
80
87 VectorDistribution(const ISpace& space, Arccore::Integer local_size,
88 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> parallel_mng);
89
96 VectorDistribution(Arccore::Integer global_size, Arccore::Integer local_size,
97 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
98
105 VectorDistribution(Arccore::Integer global_size, Arccore::Integer local_size,
106 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> parallel_mng);
107
113
119
122
129
136
142 bool operator==(const VectorDistribution& dist) const;
143
148 bool isParallel() const;
149
154 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> sharedParallelMng() const;
155
160 Arccore::MessagePassing::IMessagePassingMng* parallelMng() const;
161
166 const ISpace& space() const;
167
172 Arccore::Integer localSize() const;
173
178 Arccore::Integer globalSize() const;
179
184 Arccore::Integer offset() const;
185
191 Arccore::Integer offset(Arccore::Integer p) const;
192
197
198 Arccore::ConstArrayView<Integer> offsets() const;
199
205 Arccore::Integer owner(Arccore::Integer i) const;
206
211 std::shared_ptr<VectorDistribution> clone() const;
212
218 Arccore::Integer globalToLocal(Arccore::Integer i) const;
219
220 private:
227 Arccore::Integer globalToLocal(Arccore::Integer i, Arccore::Integer p) const;
228
234 Arccore::Integer localToGlobal(Arccore::Integer i) const;
235
242 Arccore::Integer localToGlobal(Arccore::Integer i, Arccore::Integer p) const;
243
244 // due to 'private' of VectorDistribution methods
245 // will be removed
246 friend class MatrixDistribution;
247
248 private:
249 struct Internal;
251 std::shared_ptr<Internal> m_internal;
252};
253
254/*---------------------------------------------------------------------------*/
255/*---------------------------------------------------------------------------*/
256
258extern ALIEN_EXPORT std::ostream& operator<<(
259std::ostream& nout, const VectorDistribution& dist);
260
261/*---------------------------------------------------------------------------*/
262/*---------------------------------------------------------------------------*/
263
264} // namespace Alien
265
266/*---------------------------------------------------------------------------*/
267/*---------------------------------------------------------------------------*/
ISpace.h.
Interface for algebraic space objects.
Definition ISpace.h:44
Computes a vector distribution.
VectorDistribution & operator=(const VectorDistribution &dist)
Equal operator.
std::shared_ptr< VectorDistribution > clone() const
Clone the distribution.
VectorDistribution(const ISpace &space, Arccore::Integer local_size, std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > parallel_mng)
Constructor.
bool operator==(const VectorDistribution &dist) const
Comparison operator.
std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > sharedParallelMng() const
Get the parallel manager.
Arccore::Integer offset(Arccore::Integer p) const
Get the offset for a specific proc.
Arccore::Integer offset() const
Get the offset.
Arccore::ConstArrayView< Integer > offsets() const
Get all the offsets.
const ISpace & space() const
Get the space.
Arccore::Integer owner(Arccore::Integer i) const
Get the owner of an entry.
Arccore::Integer localToGlobal(Arccore::Integer i) const
Get the global id of an elements with its local id.
Arccore::Integer globalToLocal(Arccore::Integer i) const
Get the local id of an elements with its global id.
VectorDistribution(const ISpace &space, Arccore::Integer local_size, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
VectorDistribution(Arccore::Integer global_size, Arccore::Integer local_size, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
VectorDistribution(Arccore::Integer global_size, Arccore::Integer local_size, std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > parallel_mng)
Constructor.
Arccore::Integer localSize() const
Get the local size.
bool isParallel() const
Whether or not the run is parallel.
VectorDistribution(const ISpace &space, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
VectorDistribution(Arccore::Integer global_size, std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > parallel_mng)
Constructor.
Arccore::Integer localToGlobal(Arccore::Integer i, Arccore::Integer p) const
Get the global id of a non local element with its local id.
Arccore::Integer globalSize() const
Get the global size.
VectorDistribution(const ISpace &space, std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > parallel_mng)
Constructor.
Arccore::MessagePassing::IMessagePassingMng * parallelMng() const
Get the parallel manager.
Arccore::Integer globalToLocal(Arccore::Integer i, Arccore::Integer p) const
Get the local id of a non local element with its global id.
VectorDistribution(Arccore::Integer global_size, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
~VectorDistribution()
Free resources.
std::shared_ptr< Internal > m_internal
Internal implementation of the vector distribution.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17
std::ostream & operator<<(std::ostream &nout, const MatrixDistribution &dist)
Print the distribution.
Internal implementation of the vector distribution.