Scippy

UG

Ubiquity Generator framework

paraDeterministicTimer.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and software framework */
4/* UG --- Ubquity Generator Framework */
5/* */
6/* Copyright Written by Yuji Shinano <shinano@zib.de>, */
7/* Copyright (C) 2021-2024 by Zuse Institute Berlin, */
8/* licensed under LGPL version 3 or later. */
9/* Commercial licenses are available through <licenses@zib.de> */
10/* */
11/* This code is free software; you can redistribute it and/or */
12/* modify it under the terms of the GNU Lesser General Public License */
13/* as published by the Free Software Foundation; either version 3 */
14/* of the License, or (at your option) any later version. */
15/* */
16/* This program is distributed in the hope that it will be useful, */
17/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
19/* GNU Lesser General Public License for more details. */
20/* */
21/* You should have received a copy of the GNU Lesser General Public License */
22/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
23/* */
24/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
25
26/**@file paraDeterministicTimer.h
27 * @brief Base class for deterministic timer
28 * @author Yuji Shinano
29 *
30 *
31 *
32 */
33
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35
36
37#ifndef __PARA_DETERMINISTIC_TIMER_H__
38#define __PARA_DETERMINISTIC_TIMER_H__
39
40#include "paraComm.h"
41
42namespace UG
43{
44
45///
46/// class for deterministic timer
47///
48/// void init() as a public function:\n
49/// if you want to set original initial time, you can do the init() function.
50/// arguments of the init() should be different depending on MIP solver parallelized
51/// So, add init() function in derived classes and use it in constructor of
52/// xxxParaSolver class
53///
55{
56
57public:
58
59 ///
60 /// default constructor of ParaDeterministicTimer
61 ///
63 )
64 {
65 }
66
67 ///
68 /// destructor of ParaDeterministicTimer
69 ///
71 )
72 {
73 }
74
75 ///
76 /// some normalization for the deterministic time might be needed
77 /// user can do it in this function
78 ///
79 virtual void normalize(
80 ParaComm *comm ///< communicator used
81 )
82 {
83 }
84
85 ///
86 /// update function of the deterministic time.
87 /// the deterministic time is a kind of counter
88 ///
89 virtual void update(
90 double value ///< added value to the deterministic time
91 ) = 0;
92
93 ///
94 /// getter of the deterministic time
95 ///
96 virtual double getElapsedTime(
97 ) = 0;
98
99};
100
101}
102
103#endif // __PARA_TIMER_H__
Base class of communicator object.
Definition: paraComm.h:102
class for deterministic timer
virtual void update(double value)=0
update function of the deterministic time. the deterministic time is a kind of counter
virtual ~ParaDeterministicTimer()
destructor of ParaDeterministicTimer
ParaDeterministicTimer()
default constructor of ParaDeterministicTimer
virtual void normalize(ParaComm *comm)
some normalization for the deterministic time might be needed user can do it in this function
virtual double getElapsedTime()=0
getter of the deterministic time
static ScipParaCommTh * comm
Definition: fscip.cpp:73
Base class of communicator for UG Framework.