Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
SolverStat.h
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#pragma once
20
21#include <alien/utils/Precomp.h>
22
23#include <arccore/base/String.h>
24#include <arccore/trace/ITraceMng.h>
25
27
28/*---------------------------------------------------------------------------*/
29
30namespace Alien
31{
32
33/*---------------------------------------------------------------------------*/
34
35class ALIEN_EXPORT SolverStat
36{
37 public:
38 template <typename SolverT> friend class SolverStater;
40 SolverStat();
41
43 virtual ~SolverStat() {}
44
45 public:
46 Integer solveCount() const;
47 Integer iterationCount() const;
48 Real initializationTime() const;
49 Real initializationCpuTime() const;
50 Real prepareTime() const;
51 Real prepareCpuTime() const;
52 Real solveTime() const;
53 Real solveCpuTime() const;
54
55 Integer lastIterationCount() const;
56 Real lastPrepareTime() const;
57 Real lastPrepareCpuTime() const;
58 Real lastSolveTime() const;
59 Real lastSolveCpuTime() const;
60
61 void reset();
62
63 public:
64 void print(
65 ITraceMng* traceMng, const SolverStatus& status, String title = String()) const;
66
67 protected:
68 Integer m_solve_count;
69 Integer m_iteration_count;
70 Integer m_last_iteration_count;
71 Real m_initialization_time, m_initialization_cpu_time;
72 Real m_prepare_time, m_prepare_cpu_time;
73 Real m_last_prepare_time, m_last_prepare_cpu_time;
74 Real m_solve_time, m_solve_cpu_time;
75 Real m_last_solve_time, m_last_solve_cpu_time;
76
77 private:
78 class InternalTraceSizer;
79 void _internalPrint(std::ostream& o, const Integer prefix_size,
80 const SolverStatus& status, String title) const;
81};
82
83/*---------------------------------------------------------------------------*/
84} // namespace Alien
85
86/*---------------------------------------------------------------------------*/
ILinearSolver.h.
virtual ~SolverStat()
Definition SolverStat.h:43
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17
Structure to store a solver status.