Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
VBlockSizes.h
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
19/*!
20 * \file VBlockSizes.h
21 * \brief VBlockSizes.h
22 */
23
24#pragma once
25
29#include <alien/utils/Precomp.h>
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34namespace Alien
35{
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40/*!
41 * \ingroup block
42 * \brief Compute the actual size of variable block size algebraic elements
43 *
44 * This class will refer to scalarized sizes, which means the actual size of the algebraic
45 * elements, as if it was not a block element.
46 * For exemple, a vector with two block 2x1 entries has a size of two and a scalarized
47 * size of four (2 elements for each block).
48 *
49 */
50class ALIEN_EXPORT VBlockSizes final
51{
52 public:
53 /*!
54 * \brief Constructor for vectors variable blocks
55 * \param[in] block The variable blocks
56 * \param[in] dist The vector distribution
57 */
58 VBlockSizes(const VBlock& block, const VectorDistribution& dist);
59
60 /*!
61 * \brief Constructor for matrices variable blocks
62 * \param[in] block The variable blocks
63 * \param[in] dist The matrix distribution
64 */
65 VBlockSizes(const VBlock& block, const MatrixDistribution& dist);
66
67 //! Free resources
69
70 private:
71 VBlockSizes(VBlockSizes&& block) = delete;
72 VBlockSizes& operator=(const VBlockSizes& block) = delete;
73
74 public:
75 /*!
76 * \brief Get the "scalarized" local size
77 * \returns The actual local size
78 */
79 Arccore::Integer localSize() const;
80
81 /*!
82 * \brief Get the "scalarized" global size
83 * \returns The actual global size
84 */
85 Arccore::Integer globalSize() const;
86
87 /*!
88 * \brief Get the "scalarized" offset
89 * \returns The actual offset
90 */
91 Arccore::Integer offset() const;
92
93 /*!
94 * \brief Copy this object
95 * \returns A copy of this object
96 */
97 // FIXME: not implemented yet !
98 std::shared_ptr<VBlockSizes> clone() const;
99
100 private:
101 /*!
102 * \brief Compute the actual sizes and offset of variable block size algebraic elements
103 * \param[in] all_block_size All variable block size elements
104 * \param[in] local_size Local size (where one block count as one)
105 * \param[in] local_offset Local offset (where one block count as one)
106 * \param[in] parallel_mng The parallel manager
107 */
108 void compute(const VBlock::ValuePerBlock& all_blocks_sizes, Arccore::Integer local_size,
109 Arccore::Integer local_offset,
110 Arccore::MessagePassing::IMessagePassingMng* parallel_mng);
111
112 //! Scalarized local size
113 Arccore::Integer m_local_scalarized_size;
114 //! Scalarized global size
115 Arccore::Integer m_global_scalarized_size;
116 //! Scalarized offset
117 Arccore::Integer m_scalarized_offset;
118};
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123} // namespace Alien
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
MatrixDistribution.h.
VBlock.h.
VectorDistribution.h.
Computes a matrix distribution.
Compute the actual size of variable block size algebraic elements.
Definition VBlockSizes.h:51
std::shared_ptr< VBlockSizes > clone() const
Copy this object.
VBlockSizes(const VBlock &block, const VectorDistribution &dist)
Constructor for vectors variable blocks.
~VBlockSizes()
Free resources.
Definition VBlockSizes.h:68
Variable size block elements for block matrices.
Definition VBlock.h:46
VMap< Arccore::Integer, Arccore::Integer > ValuePerBlock
Type of the size of each block.
Definition VBlock.h:49
Computes a vector distribution.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17