Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
AlephTopology.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/* AlephTopology.h (C) 2000-2024 */
9/* */
10/*---------------------------------------------------------------------------*/
11#ifndef ALEPH_TOPOLOGY_H
12#define ALEPH_TOPOLOGY_H
13/*---------------------------------------------------------------------------*/
14/*---------------------------------------------------------------------------*/
15
16#include "arcane/aleph/AlephGlobal.h"
17
18#include "arcane/utils/TraceAccessor.h"
19#include "arcane/utils/Array.h"
20#include "arcane/utils/FatalErrorException.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
33class ARCANE_ALEPH_EXPORT AlephTopology
34: public TraceAccessor
35{
36 public:
37
38 explicit AlephTopology(AlephKernel*);
39 AlephTopology(ITraceMng*, AlephKernel*, Integer, Integer);
40 virtual ~AlephTopology();
41
42 public:
43
44 void create(Integer);
45 void setRowNbElements(IntegerConstArrayView row_nb_element);
46 IntegerConstArrayView ptr_low_up_array();
48 IParallelMng* parallelMng();
49 void rowRange(Integer& min_row, Integer& max_row);
50
51 private:
52
53 inline void checkForInit()
54 {
55 if (m_has_been_initialized == false)
56 throw FatalErrorException("AlephTopology::create", "Has not been yet initialized!");
57 }
58
59 public:
60
61 Integer rowLocalRange(const Integer);
62 AlephKernel* kernel(void) { return m_kernel; }
63 Integer nb_row_size(void)
64 { /*checkForInit();*/
65 return m_nb_row_size;
66 }
67 Integer nb_row_rank(void)
68 {
69 checkForInit();
70 return m_nb_row_rank;
71 }
72 AlephInt gathered_nb_row(Integer i)
73 {
74 checkForInit();
75 return m_gathered_nb_row[i];
76 }
77 ArrayView<AlephInt> gathered_nb_row_elements(void)
78 {
79 checkForInit();
80 return m_gathered_nb_row_elements;
81 }
82 ArrayView<AlephInt> gathered_nb_setValued(void)
83 {
84 checkForInit();
85 return m_gathered_nb_setValued;
86 }
87 AlephInt gathered_nb_setValued(Integer i)
88 {
89 checkForInit();
90 return m_gathered_nb_setValued[i];
91 }
92 bool hasSetRowNbElements(void) { return m_has_set_row_nb_elements; }
93
94 private:
95
96 AlephKernel* m_kernel;
97 Integer m_nb_row_size; // Number of matrix rows distributed across the set
98 Integer m_nb_row_rank; // Number of matrix rows viewed from my rank
99 UniqueArray<AlephInt> m_gathered_nb_row; // Row indices per CPU
100 UniqueArray<AlephInt> m_gathered_nb_row_elements; // Number of elements per row
101 UniqueArray<AlephInt> m_gathered_nb_setValued; // Number of setValued elements per CPU
102 bool m_created;
103 bool m_has_set_row_nb_elements;
104 bool m_has_been_initialized;
105};
106
107/*---------------------------------------------------------------------------*/
108/*---------------------------------------------------------------------------*/
109
110} // namespace Arcane
111
112/*---------------------------------------------------------------------------*/
113/*---------------------------------------------------------------------------*/
114
115#endif
Modifiable view of an array of type T.
Constant view of an array of type T.
Interface of the parallelism manager for a subdomain.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
int AlephInt
Default type for indexing rows and columns of matrices and vectors.
Definition AlephGlobal.h:50
ConstArrayView< Integer > IntegerConstArrayView
C equivalent of a 1D array of integers.
Definition UtilsTypes.h:486