Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
BaseMatrixProfiler.h
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
8
9#pragma once
10
11#include <vector>
12
13#include <arccore/message_passing/MessagePassingGlobal.h>
14#include <alien/data/IMatrix.h>
15
16/*---------------------------------------------------------------------------*/
17/*---------------------------------------------------------------------------*/
18
19namespace Alien
20{
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25template <typename Scalar>
26class SimpleCSRMatrix;
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Common
32{
33
34 /*---------------------------------------------------------------------------*/
35 /*---------------------------------------------------------------------------*/
36
37 template <typename ValueT = Real, typename MatrixImplT = SimpleCSRMatrix<ValueT>>
39 {
40 public:
41 typedef MatrixImplT MatrixImplType ;
42 explicit MatrixProfilerT(IMatrix& matrix);
43
44 virtual ~MatrixProfilerT();
45
46 void addMatrixEntry(Integer iIndex, Integer jIndex);
47
48 void allocate();
49
50 private:
51 IMatrix& m_matrix;
52
53 MatrixImplType* m_matrix_impl = nullptr;
54
56 typedef std::vector<Integer> VectorDefinition;
57
59 typedef UniqueArray<VectorDefinition> MatrixDefinition;
60
63
65 Integer m_local_offset = 0;
66 Integer m_global_size = 0;
67 Integer m_local_size = 0;
68
69 bool m_square_matrix = false;
70 Integer m_col_local_offset = 0;
71 Integer m_col_global_size = 0;
72 Integer m_col_local_size = 0;
73
74 Integer m_nproc = 1;
75 IMessagePassingMng* m_parallel_mng = nullptr;
76 ITraceMng* m_trace = nullptr;
77
78 bool m_allocated = false;
79
80 private:
81 void _startTimer() {}
82 void computeProfile();
83 void _stopTimer() {}
84 };
85
86 /*---------------------------------------------------------------------------*/
87 /*---------------------------------------------------------------------------*/
88
89} // namespace Common
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
94} // namespace Alien
95
96/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98
99#include "MatrixProfilerT.h"
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
IMatrix.h.
std::vector< Integer > VectorDefinition
Integer m_local_offset
Global matrix informations.
MatrixProfilerT(IMatrix &matrix)
Scalar matrix builder.
UniqueArray< VectorDefinition > MatrixDefinition
Interface for all matrices.
Definition IMatrix.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17