Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
MatrixDistribution.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/base/BaseTypes.h>
16#include <arccore/message_passing/MessagePassingGlobal.h>
17
18#include <alien/data/ISpace.h>
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Alien
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
40class ALIEN_EXPORT MatrixDistribution
41{
42 public:
45
52 MatrixDistribution(const ISpace& row_space, const ISpace& col_space,
53 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
54
61 MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size,
62 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
63
70 MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size,
71 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> parallel_mng);
72
80 MatrixDistribution(const ISpace& row_space, const ISpace& col_space,
81 Integer local_row_size, IMessagePassingMng* parallel_mng);
82
91 MatrixDistribution(const ISpace& row_space, const ISpace& col_space,
92 Integer local_row_size, Integer local_col_size, IMessagePassingMng* parallel_mng);
93
101 MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size,
102 Arccore::Integer local_row_size,
103 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
104
113 MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size,
114 Arccore::Integer local_row_size, Arccore::Integer local_col_size,
115 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
116
124 MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size,
125 Arccore::Integer local_row_size,
126 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> parallel_mng);
127
136 MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size,
137 Arccore::Integer local_row_size, Arccore::Integer local_col_size,
138 std::shared_ptr<Arccore::MessagePassing::IMessagePassingMng> parallel_mng);
139
145
151
154
161
168
174 bool operator==(const MatrixDistribution& dist) const;
175
180 bool isParallel() const;
181
186 Arccore::MessagePassing::IMessagePassingMng* parallelMng() const;
187
192 const VectorDistribution& rowDistribution() const;
193
198 const VectorDistribution& colDistribution() const;
199
204 const ISpace& rowSpace() const;
205
210 const ISpace& colSpace() const;
211
216 Arccore::Integer localRowSize() const;
217
222 Arccore::Integer localColSize() const;
223
228 Arccore::Integer globalRowSize() const;
229
234 Arccore::Integer globalColSize() const;
235
240 Arccore::Integer rowOffset() const;
241
247 Arccore::Integer rowOffset(Arccore::Integer p) const;
248
253 Arccore::Integer colOffset() const;
254
260 Arccore::Integer colOffset(Arccore::Integer p) const;
261
266 std::shared_ptr<MatrixDistribution> clone() const;
267
268 private:
274 Arccore::Integer rowGlobalToLocal(Arccore::Integer i) const;
275
282 Arccore::Integer rowGlobalToLocal(Arccore::Integer i, Arccore::Integer p) const;
283
289 Arccore::Integer colGlobalToLocal(Arccore::Integer i) const;
290
297 Arccore::Integer colGlobalToLocal(Arccore::Integer i, Arccore::Integer p) const;
298
304 Arccore::Integer rowLocalToGlobal(Arccore::Integer i) const;
305
312 Arccore::Integer rowLocalToGlobal(Arccore::Integer i, Arccore::Integer p) const;
313
319 Arccore::Integer colLocalToGlobal(Arccore::Integer i) const;
320
327 Arccore::Integer colLocalToGlobal(Arccore::Integer i, Arccore::Integer p) const;
328
335 Arccore::Integer owner(Arccore::Integer i, Arccore::Integer j) const;
336
337 private:
338 struct Internal;
340 std::shared_ptr<Internal> m_internal;
341};
342
343/*---------------------------------------------------------------------------*/
344/*---------------------------------------------------------------------------*/
345
347extern ALIEN_EXPORT std::ostream& operator<<(
348std::ostream& nout, const MatrixDistribution& dist);
349
350/*---------------------------------------------------------------------------*/
351/*---------------------------------------------------------------------------*/
352
353} // namespace Alien
354
355/*---------------------------------------------------------------------------*/
356/*---------------------------------------------------------------------------*/
ISpace.h.
Interface for algebraic space objects.
Definition ISpace.h:44
Computes a matrix distribution.
const VectorDistribution & rowDistribution() const
Get the row distribution.
bool isParallel() const
Whether or not the run is parallel.
MatrixDistribution(const ISpace &row_space, const ISpace &col_space, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
Arccore::Integer rowGlobalToLocal(Arccore::Integer i) const
Get the local id of a row with its global id.
Arccore::Integer globalColSize() const
Get the global col size.
Arccore::Integer colGlobalToLocal(Arccore::Integer i) const
Get the local id of a col with its global id.
Arccore::Integer localColSize() const
Get the local col size.
Arccore::Integer rowGlobalToLocal(Arccore::Integer i, Arccore::Integer p) const
Get the local id of a non local row with its global id.
Arccore::Integer rowLocalToGlobal(Arccore::Integer i) const
Get the global id of a row with its local id.
Arccore::Integer localRowSize() const
Get the local row size.
MatrixDistribution & operator=(const MatrixDistribution &dist)
Operator equal.
MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size, Arccore::Integer local_row_size, std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > parallel_mng)
Constructor.
Arccore::Integer rowLocalToGlobal(Arccore::Integer i, Arccore::Integer p) const
Get the global id of a non local row with its local id.
const ISpace & rowSpace() const
Get the row space.
Arccore::Integer colGlobalToLocal(Arccore::Integer i, Arccore::Integer p) const
Get the local id of a non local col with its global id.
MatrixDistribution(const MatrixDistribution &dist)
Copy constructor.
MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
MatrixDistribution(MatrixDistribution &&dist)
Rvalue constructor.
std::shared_ptr< Internal > m_internal
Internal implementation of the matrix distribution.
MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size, Arccore::Integer local_row_size, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size, std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > parallel_mng)
Constructor.
Arccore::Integer globalRowSize() const
Get the global row size.
bool operator==(const MatrixDistribution &dist) const
Comparison operator.
MatrixDistribution & operator=(MatrixDistribution &&dist)
Operator equal.
Arccore::Integer colLocalToGlobal(Arccore::Integer i, Arccore::Integer p) const
Get the global id of a non local col with its local id.
Arccore::Integer rowOffset(Arccore::Integer p) const
Get the row offset for a specific proc.
std::shared_ptr< MatrixDistribution > clone() const
Clone the distribution.
MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size, Arccore::Integer local_row_size, Arccore::Integer local_col_size, Arccore::MessagePassing::IMessagePassingMng *parallel_mng)
Constructor.
const ISpace & colSpace() const
Get the col space.
MatrixDistribution(Arccore::Integer global_row_size, Arccore::Integer global_col_size, Arccore::Integer local_row_size, Arccore::Integer local_col_size, std::shared_ptr< Arccore::MessagePassing::IMessagePassingMng > parallel_mng)
Constructor.
Arccore::Integer colLocalToGlobal(Arccore::Integer i) const
Get the global id of a col with its local id.
Arccore::Integer colOffset(Arccore::Integer p) const
Get the col offset for a specific proc.
const VectorDistribution & colDistribution() const
Get the col distribution.
Arccore::Integer colOffset() const
Get the col offset.
Arccore::Integer rowOffset() const
Get the row offset.
Arccore::MessagePassing::IMessagePassingMng * parallelMng() const
Get the parallel manager.
Arccore::Integer owner(Arccore::Integer i, Arccore::Integer j) const
Get the owner of an entry.
~MatrixDistribution()
Free resources.
Computes a 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 matrix distribution.