UG

Ubiquity Generator framework

paraCalculationState.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-2026 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 paraCalculationState.h
27 * @brief Base class for calculation state.
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_CALCULATION_STATE_H__
38#define __PARA_CALCULATION_STATE_H__
39
40#include <climits>
41#include <cfloat>
42#include "paraComm.h"
43
44namespace UG
45{
46
47///
48/// \class ParaCalculationState
49/// Abstract interface for calculation state in a ParaSolver.
50/// Holds no data; derived classes own the fields.
51///
53{
54public:
55
57 )
58 {
59 }
60
61 virtual
63 )
64 {
65 }
66
67 ///
68 /// getter of computing time of a subproblem
69 /// @return subroblem computing time
70 ///
71 virtual double getCompTime(
72 ) = 0;
73
74 ///
75 /// getter of the number of tasks solved in a subproblem
76 /// @return the number of tasks
77 ///
78 virtual int getNSolved(
79 ) = 0;
80
81 ///
82 /// getter of the termination state for solving the subproblem
83 /// @return the termination state
84 ///
86 ) = 0;
87
88 ///
89 /// stringfy ParaCalculationState
90 /// @return string to show this object
91 ///
92 virtual std::string toString(
93 ) = 0;
94
95 ///
96 /// stringfy ParaCalculationState (simple string version)
97 /// @return simple string to show this object
98 ///
99 virtual std::string toSimpleString(
100 ) = 0;
101
102 ///
103 /// send this object to destination
104 ///
105 virtual void send(
106 ParaComm *comm, ///< communicator used to send this object
107 int destination, ///< destination rank to send
108 int tag ///< tag to show this object
109 ) = 0;
110
111 ///
112 /// send this object to destination
113 ///
114 virtual void receive(
115 ParaComm *comm, ///< communicator used to receive this object
116 int source, ///< source rank to receive this object
117 int tag ///< tag to show this object
118 ) = 0;
119
120};
121
122}
123
124#endif // __PARA_CALCULATION_STATE_H__
Abstract interface for calculation state in a ParaSolver. Holds no data; derived classes own the fiel...
virtual void send(ParaComm *comm, int destination, int tag)=0
send this object to destination
virtual int getTerminationState()=0
getter of the termination state for solving the subproblem
virtual double getCompTime()=0
getter of computing time of a subproblem
virtual std::string toSimpleString()=0
stringfy ParaCalculationState (simple string version)
virtual std::string toString()=0
stringfy ParaCalculationState
virtual int getNSolved()=0
getter of the number of tasks solved in a subproblem
virtual void receive(ParaComm *comm, int source, int tag)=0
send this object to destination
Base class of communicator object.
Definition: paraComm.h:102
static ScipParaCommTh * comm
Definition: fscip.cpp:73
Base class of communicator for UG Framework.