Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
MatrixDistribution.cc
Go to the documentation of this file.
1/*
2 * Copyright 2020 IFPEN-CEA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
23
24#include "MatrixDistribution.h"
25
26#include <iostream>
27
28#include <alien/data/Space.h>
30#include <alien/utils/Trace.h>
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35namespace Alien
36{
37
38using namespace Arccore;
39using namespace Arccore::MessagePassing;
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
46{
48 Internal();
49
50 /*
51 * \brief Constructor
52 * \param[in] row_space The row space of the matrix
53 * \param[in] col_space The col space of the matrix
54 * \param[in] parallel_mng The parallel manager
55 */
57 const ISpace& row_space, const ISpace& col_space, IMessagePassingMng* parallel_mng);
58
59 /*
60 * \brief Constructor
61 * \param[in] row_space The row space of the matrix
62 * \param[in] col_space The col space of the matrix
63 * \param[in] parallel_mng The parallel manager
64 */
65 Internal(const ISpace& row_space, const ISpace& col_space,
66 std::shared_ptr<IMessagePassingMng> parallel_mng);
67
68 /*
69 * \brief Constructor
70 * \param[in] global_row_size The number of rows in the matrix
71 * \param[in] global_col_size The number of cols in the matrix
72 * \param[in] parallel_mng The parallel manager
73 */
75 Integer global_row_size, Integer global_col_size, IMessagePassingMng* parallel_mng);
76
77 /*
78 * \brief Constructor
79 * \param[in] global_row_size The number of rows in the matrix
80 * \param[in] global_col_size The number of cols in the matrix
81 * \param[in] parallel_mng The parallel manager
82 */
83 Internal(Integer global_row_size, Integer global_col_size,
84 std::shared_ptr<IMessagePassingMng> parallel_mng);
85
86 /*
87 * \brief Constructor
88 * \param[in] row_space The row space of the matrix
89 * \param[in] col_space The col space of the matrix
90 * \param[in] local_row_size The number of local rows in the matrix
91 * \param[in] parallel_mng The parallel manager
92 */
93 Internal(const ISpace& row_space, const ISpace& col_space, Integer local_row_size,
94 IMessagePassingMng* parallel_mng);
95
96 /*
97 * \brief Constructor
98 * \param[in] row_space The row space of the matrix
99 * \param[in] col_space The col space of the matrix
100 * \param[in] local_row_size The number of local rows in the matrix
101 * \param[in] local_col_size The number of local cols in the matrix
102 * \param[in] parallel_mng The parallel manager
103 */
104 Internal(const ISpace& row_space, const ISpace& col_space, Integer local_row_size,
105 Integer local_col_size, IMessagePassingMng* parallel_mng);
106
107 /*
108 * \brief Constructor
109 * \param[in] row_space The row space of the matrix
110 * \param[in] col_space The col space of the matrix
111 * \param[in] local_row_size The number of local rows in the matrix
112 * \param[in] parallel_mng The parallel manager
113 */
114 Internal(const ISpace& row_space, const ISpace& col_space, Integer local_row_size,
115 std::shared_ptr<IMessagePassingMng> parallel_mng);
116
117 /*
118 * \brief Constructor
119 * \param[in] row_space The row space of the matrix
120 * \param[in] col_space The col space of the matrix
121 * \param[in] local_row_size The number of local rows in the matrix
122 * \param[in] local_col_size The number of local cols in the matrix
123 * \param[in] parallel_mng The parallel manager
124 */
125 Internal(const ISpace& row_space, const ISpace& col_space, Integer local_row_size,
126 Integer local_col_size, std::shared_ptr<IMessagePassingMng> parallel_mng);
127
128 /*
129 * \brief Constructor
130 * \param[in] global_row_size The number of rows in the matrix
131 * \param[in] global_col_size The number of cols in the matrix
132 * \param[in] local_row_size The number of local cols in the matrix
133 * \param[in] parallel_mng The parallel manager
134 */
135 Internal(Integer global_row_size, Integer global_col_size, Integer local_row_size,
136 IMessagePassingMng* parallel_mng);
137
138 /*
139 * \brief Constructor
140 * \param[in] global_row_size The number of rows in the matrix
141 * \param[in] global_col_size The number of cols in the matrix
142 * \param[in] local_row_size The number of local cols in the matrix
143 * \param[in] local_col_size The number of local cols in the matrix
144 * \param[in] parallel_mng The parallel manager
145 */
146 Internal(Integer global_row_size, Integer global_col_size, Integer local_row_size,
147 Integer local_col_size, IMessagePassingMng* parallel_mng);
148
149 /*
150 * \brief Constructor
151 * \param[in] global_row_size The number of rows in the matrix
152 * \param[in] global_col_size The number of cols in the matrix
153 * \param[in] local_row_size The number of local cols in the matrix
154 * \param[in] parallel_mng The parallel manager
155 */
156 Internal(Integer global_row_size, Integer global_col_size, Integer local_row_size,
157 std::shared_ptr<IMessagePassingMng> parallel_mng);
158
159 /*
160 * \brief Constructor
161 * \param[in] global_row_size The number of rows in the matrix
162 * \param[in] global_col_size The number of cols in the matrix
163 * \param[in] local_row_size The number of local cols in the matrix
164 * \param[in] local_col_size The number of local cols in the matrix
165 * \param[in] parallel_mng The parallel manager
166 */
167 Internal(Integer global_row_size, Integer global_col_size, Integer local_row_size,
168 Integer local_col_size, std::shared_ptr<IMessagePassingMng> parallel_mng);
169
175 bool operator==(const Internal& dist) const;
176
178 std::shared_ptr<VectorDistribution> m_row_distribution;
180 std::shared_ptr<VectorDistribution> m_col_distribution;
181};
182
183/*---------------------------------------------------------------------------*/
184/*---------------------------------------------------------------------------*/
185
189
190/*---------------------------------------------------------------------------*/
191/*---------------------------------------------------------------------------*/
192
194const ISpace& row_space, const ISpace& col_space, IMessagePassingMng* parallel_mng)
195: m_row_distribution(std::make_shared<VectorDistribution>(row_space, parallel_mng))
196, m_col_distribution(std::make_shared<VectorDistribution>(col_space, parallel_mng))
197{}
198
199/*---------------------------------------------------------------------------*/
200/*---------------------------------------------------------------------------*/
201
202MatrixDistribution::Internal::Internal(const ISpace& row_space, const ISpace& col_space,
203 std::shared_ptr<IMessagePassingMng> parallel_mng)
204: m_row_distribution(std::make_shared<VectorDistribution>(row_space, parallel_mng))
205, m_col_distribution(std::make_shared<VectorDistribution>(col_space, parallel_mng))
206{}
207
208/*---------------------------------------------------------------------------*/
209/*---------------------------------------------------------------------------*/
210
212Integer global_row_size, Integer global_col_size, IMessagePassingMng* parallel_mng)
213: Internal(Space(global_row_size), Space(global_col_size), parallel_mng)
214{}
215
216/*---------------------------------------------------------------------------*/
217/*---------------------------------------------------------------------------*/
218
219MatrixDistribution::Internal::Internal(Integer global_row_size, Integer global_col_size,
220 std::shared_ptr<IMessagePassingMng> parallel_mng)
221: Internal(Space(global_row_size), Space(global_col_size), parallel_mng)
222{}
223
224/*---------------------------------------------------------------------------*/
225/*---------------------------------------------------------------------------*/
226
227MatrixDistribution::Internal::Internal(const ISpace& row_space, const ISpace& col_space,
228 Integer local_row_size, IMessagePassingMng* parallel_mng)
229: m_row_distribution(
230 std::make_shared<VectorDistribution>(row_space, local_row_size, parallel_mng))
231, m_col_distribution(std::make_shared<VectorDistribution>(col_space, parallel_mng))
232{}
233
234/*---------------------------------------------------------------------------*/
235/*---------------------------------------------------------------------------*/
236
237MatrixDistribution::Internal::Internal(const ISpace& row_space, const ISpace& col_space,
238 Integer local_row_size, Integer local_col_size, IMessagePassingMng* parallel_mng)
239: m_row_distribution(
240 std::make_shared<VectorDistribution>(row_space, local_row_size, parallel_mng))
241, m_col_distribution(
242 std::make_shared<VectorDistribution>(col_space, local_col_size, parallel_mng))
243{}
244
245/*---------------------------------------------------------------------------*/
246/*---------------------------------------------------------------------------*/
247
248MatrixDistribution::Internal::Internal(const ISpace& row_space, const ISpace& col_space,
249 Integer local_row_size, std::shared_ptr<IMessagePassingMng> parallel_mng)
250: m_row_distribution(
251 std::make_shared<VectorDistribution>(row_space, local_row_size, parallel_mng))
252, m_col_distribution(std::make_shared<VectorDistribution>(col_space, parallel_mng))
253{}
254
255/*---------------------------------------------------------------------------*/
256/*---------------------------------------------------------------------------*/
257
258MatrixDistribution::Internal::Internal(const ISpace& row_space, const ISpace& col_space,
259 Integer local_row_size, Integer local_col_size,
260 std::shared_ptr<IMessagePassingMng> parallel_mng)
261: m_row_distribution(
262 std::make_shared<VectorDistribution>(row_space, local_row_size, parallel_mng))
263, m_col_distribution(
264 std::make_shared<VectorDistribution>(col_space, local_col_size, parallel_mng))
265{}
266
267/*---------------------------------------------------------------------------*/
268/*---------------------------------------------------------------------------*/
269
270MatrixDistribution::Internal::Internal(Integer global_row_size, Integer global_col_size,
271 Integer local_row_size, IMessagePassingMng* parallel_mng)
272: Internal(Space(global_row_size), Space(global_col_size), local_row_size, parallel_mng)
273{}
274
275/*---------------------------------------------------------------------------*/
276/*---------------------------------------------------------------------------*/
277
278MatrixDistribution::Internal::Internal(Integer global_row_size, Integer global_col_size,
279 Integer local_row_size, Integer local_col_size, IMessagePassingMng* parallel_mng)
280: Internal(Space(global_row_size), Space(global_col_size), local_row_size, local_col_size,
281 parallel_mng)
282{}
283
284/*---------------------------------------------------------------------------*/
285/*---------------------------------------------------------------------------*/
286
287MatrixDistribution::Internal::Internal(Integer global_row_size, Integer global_col_size,
288 Integer local_row_size, std::shared_ptr<IMessagePassingMng> parallel_mng)
289: Internal(Space(global_row_size), Space(global_col_size), local_row_size, parallel_mng)
290{}
291
292/*---------------------------------------------------------------------------*/
293/*---------------------------------------------------------------------------*/
294
295MatrixDistribution::Internal::Internal(Integer global_row_size, Integer global_col_size,
296 Integer local_row_size, Integer local_col_size,
297 std::shared_ptr<IMessagePassingMng> parallel_mng)
298: Internal(Space(global_row_size), Space(global_col_size), local_row_size, local_col_size,
299 parallel_mng)
300{}
301
302/*---------------------------------------------------------------------------*/
303/*---------------------------------------------------------------------------*/
304
309
310/*---------------------------------------------------------------------------*/
311/*---------------------------------------------------------------------------*/
312
314: m_internal(std::make_shared<Internal>())
315{
316 alien_debug([&] { cout() << "Create Empty MatrixDistribution"; });
317}
318
319/*---------------------------------------------------------------------------*/
320/*---------------------------------------------------------------------------*/
321
323const ISpace& row_space, const ISpace& col_space, IMessagePassingMng* parallel_mng)
324: m_internal(std::make_shared<Internal>(row_space, col_space, parallel_mng))
325{
326 alien_debug([&] {
327 cout() << "Create MatrixDistribution(rowglobal=" << row_space.size()
328 << ",colglobal=" << col_space.size() << ")";
329 });
330}
331
332/*---------------------------------------------------------------------------*/
333/*---------------------------------------------------------------------------*/
334
336Integer global_row_size, Integer global_col_size, IMessagePassingMng* parallel_mng)
337: m_internal(std::make_shared<Internal>(global_row_size, global_col_size, parallel_mng))
338{
339 alien_debug([&] {
340 cout() << "Create MatrixDistribution(rowglobal=" << global_row_size
341 << ",colglobal=" << global_col_size << ")";
342 });
343}
344
345/*---------------------------------------------------------------------------*/
346/*---------------------------------------------------------------------------*/
347
348MatrixDistribution::MatrixDistribution(Integer global_row_size, Integer global_col_size,
349 std::shared_ptr<IMessagePassingMng> parallel_mng)
350: m_internal(std::make_shared<Internal>(global_row_size, global_col_size, parallel_mng))
351{
352 alien_debug([&] {
353 cout() << "Create MatrixDistribution(rowglobal=" << global_row_size
354 << ",colglobal=" << global_col_size << ")";
355 });
356}
357
358/*---------------------------------------------------------------------------*/
359/*---------------------------------------------------------------------------*/
360
361MatrixDistribution::MatrixDistribution(const ISpace& row_space, const ISpace& col_space,
362 Integer local_row_size, IMessagePassingMng* parallel_mng)
363: m_internal(
364 std::make_shared<Internal>(row_space, col_space, local_row_size, parallel_mng))
365{
366 alien_debug([&] {
367 cout() << "Create MatrixDistribution(global_row=" << row_space.size()
368 << ",global_col=" << col_space.size() << ",local_row=" << local_row_size
369 << ")";
370 });
371}
372
373/*---------------------------------------------------------------------------*/
374/*---------------------------------------------------------------------------*/
375
376MatrixDistribution::MatrixDistribution(const ISpace& row_space, const ISpace& col_space,
377 Integer local_row_size, Integer local_col_size, IMessagePassingMng* parallel_mng)
378: m_internal(std::make_shared<Internal>(
379 row_space, col_space, local_row_size, local_col_size, parallel_mng))
380{
381 alien_debug([&] {
382 cout() << "Create MatrixDistribution(global_row=" << row_space.size()
383 << ",global_col=" << col_space.size() << ",local_row=" << local_row_size
384 << ",local_col=" << local_col_size << ")";
385 });
386}
387
388/*---------------------------------------------------------------------------*/
389/*---------------------------------------------------------------------------*/
390
391MatrixDistribution::MatrixDistribution(Integer global_row_size, Integer global_col_size,
392 Integer local_row_size, IMessagePassingMng* parallel_mng)
393: m_internal(std::make_shared<Internal>(
394 global_row_size, global_col_size, local_row_size, parallel_mng))
395{
396 alien_debug([&] {
397 cout() << "Create MatrixDistribution(global_row=" << global_row_size
398 << ",global_col=" << global_col_size << ",local_row=" << local_row_size << ")";
399 });
400}
401
402/*---------------------------------------------------------------------------*/
403/*---------------------------------------------------------------------------*/
404
405MatrixDistribution::MatrixDistribution(Integer global_row_size, Integer global_col_size,
406 Integer local_row_size, Integer local_col_size, IMessagePassingMng* parallel_mng)
407: m_internal(std::make_shared<Internal>(
408 global_row_size, global_col_size, local_row_size, local_col_size, parallel_mng))
409{
410 alien_debug([&] {
411 cout() << "Create MatrixDistribution(global_row=" << global_row_size
412 << ",global_col=" << global_col_size << ",local_row=" << local_row_size
413 << ",local_col=" << local_col_size << ")";
414 });
415}
416
417/*---------------------------------------------------------------------------*/
418/*---------------------------------------------------------------------------*/
419
420MatrixDistribution::MatrixDistribution(Integer global_row_size, Integer global_col_size,
421 Integer local_row_size, std::shared_ptr<IMessagePassingMng> parallel_mng)
422: m_internal(std::make_shared<Internal>(
423 global_row_size, global_col_size, local_row_size, parallel_mng))
424{
425 alien_debug([&] {
426 cout() << "Create MatrixDistribution(global_row=" << global_row_size
427 << ",global_col=" << global_col_size << ",local_row=" << local_row_size << ")";
428 });
429}
430
431/*---------------------------------------------------------------------------*/
432/*---------------------------------------------------------------------------*/
433
434MatrixDistribution::MatrixDistribution(Integer global_row_size, Integer global_col_size,
435 Integer local_row_size, Integer local_col_size,
436 std::shared_ptr<IMessagePassingMng> parallel_mng)
437: m_internal(std::make_shared<Internal>(
438 global_row_size, global_col_size, local_row_size, local_col_size, parallel_mng))
439{
440 alien_debug([&] {
441 cout() << "Create MatrixDistribution(global_row=" << global_row_size
442 << ",global_col=" << global_col_size << ",local_row=" << local_row_size
443 << ",local_col=" << local_col_size << ")";
444 });
445}
446
447/*---------------------------------------------------------------------------*/
448/*---------------------------------------------------------------------------*/
449
451
452/*---------------------------------------------------------------------------*/
453/*---------------------------------------------------------------------------*/
454
456
457/*---------------------------------------------------------------------------*/
458/*---------------------------------------------------------------------------*/
459
461
462/*---------------------------------------------------------------------------*/
463/*---------------------------------------------------------------------------*/
464
467{
468 return *(m_internal->m_row_distribution);
469}
470
471/*---------------------------------------------------------------------------*/
472/*---------------------------------------------------------------------------*/
473
474const ISpace&
476{
477 return m_internal->m_row_distribution->space();
478}
479
480/*---------------------------------------------------------------------------*/
481/*---------------------------------------------------------------------------*/
482
485{
486 if (m_internal->m_col_distribution.get())
487 return *(m_internal->m_col_distribution);
488 return *(m_internal->m_row_distribution);
489}
490
491/*---------------------------------------------------------------------------*/
492/*---------------------------------------------------------------------------*/
493
494const ISpace&
496{
497 return colDistribution().space();
498}
499
500/*---------------------------------------------------------------------------*/
501/*---------------------------------------------------------------------------*/
502
505/*---------------------------------------------------------------------------*/
506/*---------------------------------------------------------------------------*/
507
510
511/*---------------------------------------------------------------------------*/
512/*---------------------------------------------------------------------------*/
513
515{
516 return *m_internal == *dist.m_internal;
517}
518
519/*---------------------------------------------------------------------------*/
520/*---------------------------------------------------------------------------*/
521
523{
524 return m_internal->m_row_distribution->isParallel();
525}
526
527/*---------------------------------------------------------------------------*/
528/*---------------------------------------------------------------------------*/
529
530IMessagePassingMng*
532{
533 return m_internal->m_row_distribution->parallelMng();
534}
535
536/*---------------------------------------------------------------------------*/
537/*---------------------------------------------------------------------------*/
538
539Integer
541{
542 return m_internal->m_row_distribution->localSize();
543}
544
545/*---------------------------------------------------------------------------*/
546/*---------------------------------------------------------------------------*/
547
548Integer
550{
551 if (m_internal->m_col_distribution.get())
552 return m_internal->m_col_distribution->localSize();
553 else
554 return m_internal->m_row_distribution->localSize();
555}
556
557/*---------------------------------------------------------------------------*/
558/*---------------------------------------------------------------------------*/
559
560Integer
562{
563 return m_internal->m_row_distribution->globalSize();
564}
565
566/*---------------------------------------------------------------------------*/
567/*---------------------------------------------------------------------------*/
568
569Integer
571{
572 if (m_internal->m_col_distribution.get())
573 return m_internal->m_col_distribution->globalSize();
574 else
575 return m_internal->m_row_distribution->globalSize();
576}
577
578/*---------------------------------------------------------------------------*/
579/*---------------------------------------------------------------------------*/
580
581Integer
583{
584 return m_internal->m_row_distribution->offset();
585}
586
587/*---------------------------------------------------------------------------*/
588/*---------------------------------------------------------------------------*/
589
590Integer
591MatrixDistribution::rowOffset(Integer p) const
592{
593 return m_internal->m_row_distribution->offset(p);
594}
595
596/*---------------------------------------------------------------------------*/
597/*---------------------------------------------------------------------------*/
598
599Integer
601{
602 if (m_internal->m_col_distribution.get())
603 return m_internal->m_col_distribution->offset();
604 else
605 return m_internal->m_row_distribution->offset();
606}
607
608/*---------------------------------------------------------------------------*/
609/*---------------------------------------------------------------------------*/
610
611Integer
612MatrixDistribution::colOffset(Integer p) const
613{
614 if (m_internal->m_col_distribution.get())
615 return m_internal->m_col_distribution->offset(p);
616 else
617 return m_internal->m_row_distribution->offset(p);
618}
619
620/*---------------------------------------------------------------------------*/
621/*---------------------------------------------------------------------------*/
622
623std::shared_ptr<MatrixDistribution>
625{
626 return std::make_shared<MatrixDistribution>(*this);
627}
628
629/*---------------------------------------------------------------------------*/
630/*---------------------------------------------------------------------------*/
631
632Integer
634{
635 return m_internal->m_row_distribution->globalToLocal(i);
636}
637
638/*---------------------------------------------------------------------------*/
639/*---------------------------------------------------------------------------*/
640
641Integer
642MatrixDistribution::rowGlobalToLocal(Integer i, Integer p) const
643{
644 return m_internal->m_row_distribution->globalToLocal(i, p);
645}
646
647/*---------------------------------------------------------------------------*/
648/*---------------------------------------------------------------------------*/
649
650Integer
652{
653 return m_internal->m_row_distribution->localToGlobal(i);
654}
655
656/*---------------------------------------------------------------------------*/
657/*---------------------------------------------------------------------------*/
658
659Integer
660MatrixDistribution::rowLocalToGlobal(Integer i, Integer p) const
661{
662 return m_internal->m_row_distribution->localToGlobal(i, p);
663}
664
665/*---------------------------------------------------------------------------*/
666/*---------------------------------------------------------------------------*/
667
668Integer
670{
671 if (m_internal->m_col_distribution.get())
672 return m_internal->m_col_distribution->globalToLocal(i);
673 else
674 return m_internal->m_row_distribution->globalToLocal(i);
675}
676
677/*---------------------------------------------------------------------------*/
678/*---------------------------------------------------------------------------*/
679
680Integer
681MatrixDistribution::colGlobalToLocal(Integer i, Integer p) const
682{
683 if (m_internal->m_col_distribution.get())
684 return m_internal->m_col_distribution->globalToLocal(i, p);
685 else
686 return m_internal->m_row_distribution->globalToLocal(i, p);
687}
688
689/*---------------------------------------------------------------------------*/
690/*---------------------------------------------------------------------------*/
691
692Integer
694{
695 if (m_internal->m_col_distribution.get())
696 return m_internal->m_col_distribution->localToGlobal(i);
697 else
698 return m_internal->m_row_distribution->localToGlobal(i);
699}
700
701/*---------------------------------------------------------------------------*/
702/*---------------------------------------------------------------------------*/
703
704Integer
705MatrixDistribution::colLocalToGlobal(Integer i, Integer p) const
706{
707 if (!m_internal->m_col_distribution.get())
708 return m_internal->m_row_distribution->localToGlobal(i, p);
709 else
710 return m_internal->m_col_distribution->localToGlobal(i, p);
711}
712
713/*---------------------------------------------------------------------------*/
714/*---------------------------------------------------------------------------*/
715
716Integer
717MatrixDistribution::owner(Integer i, Integer j ALIEN_UNUSED_PARAM) const
718{
719 return m_internal->m_row_distribution->owner(i);
720}
721
722/*---------------------------------------------------------------------------*/
723/*---------------------------------------------------------------------------*/
724
725std::ostream&
726operator<<(std::ostream& nout, const MatrixDistribution& dist)
727{
728 nout << "row distributed";
729 if (dist.isParallel()) {
730 nout << ", parallel";
731 }
732 nout << ", global sizes [col=" << dist.globalColSize()
733 << ",row=" << dist.globalRowSize() << "]";
734 nout << ", local row size=" << dist.localRowSize();
735 nout << ", row offset=" << dist.rowOffset();
736 return nout;
737}
738
739/*---------------------------------------------------------------------------*/
740/*---------------------------------------------------------------------------*/
741
742} // namespace Alien
743
744/*---------------------------------------------------------------------------*/
745/*---------------------------------------------------------------------------*/
MatrixDistribution.h.
Space.h.
VectorDistribution.h.
Interface for algebraic space objects.
Definition ISpace.h:44
virtual Arccore::Integer size() const =0
Get space size.
Computes a matrix distribution.
const VectorDistribution & rowDistribution() const
Get the row distribution.
bool isParallel() const
Whether or not the run is parallel.
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 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.
const ISpace & rowSpace() const
Get the row space.
std::shared_ptr< Internal > m_internal
Internal implementation of the matrix distribution.
Arccore::Integer globalRowSize() const
Get the global row size.
bool operator==(const MatrixDistribution &dist) const
Comparison operator.
std::shared_ptr< MatrixDistribution > clone() const
Clone the distribution.
const ISpace & colSpace() const
Get the col space.
Arccore::Integer colLocalToGlobal(Arccore::Integer i) const
Get the global id of a col with its local id.
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.
const ISpace & space() const
Get the space.
-- 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.
std::shared_ptr< VectorDistribution > m_row_distribution
Row distribution.
bool operator==(const Internal &dist) const
Comparison operator.
std::shared_ptr< VectorDistribution > m_col_distribution
Col distribution.