UG

Ubiquity Generator framework

paraSolverTerminationState.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 paraSolverTerminationState.h
27 * @brief This class contains solver termination state which is transferred form Solver to LC.
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_SOLVER_TERMINATION_STATE_H__
38#define __PARA_SOLVER_TERMINATION_STATE_H__
39
40#include "paraComm.h"
41#include "paraInitiator.h"
42#ifdef UG_WITH_ZLIB
43#include "gzstream.h"
44#endif
45
46namespace UG
47{
48
49///
50/// class ParaSolverTerminationState
51/// (Solver termination state in a ParaSolver)
52///
54{
55public:
56
58 )
59 {
60 }
61
63 )
64 {
65 }
66
67 ///
68 /// stringfy ParaSolverTerminationState object
69 /// @return string to show inside of ParaSolverTerminationState object
70 ///
71 virtual std::string toString(
72 ParaInitiator *initiator ///< pointer to ParaInitiator object
73 ) = 0;
74
75 ///
76 /// getter of interrupted flag
77 /// @return true if it is interrupted, false otherwise
78 ///
79 virtual int getInterruptedMode(
80 ) = 0;
81
82 ///
83 /// getter of deterministic time
84 /// @return deterministic time
85 ///
86 virtual double getDeterministicTime(
87 ) = 0;
88
89#ifdef UG_WITH_ZLIB
90
91 ///
92 /// write ParaSolverTerminationState to checkpoint file
93 ///
94 virtual void write(
95 gzstream::ogzstream &out ///< gzstream to output
96 ) = 0;
97
98 ///
99 /// read ParaSolverTerminationState from checkpoint file
100 ///
101 virtual bool read(
102 ParaComm *comm, ///< communicator used
103 gzstream::igzstream &in ///< gzstream to input
104 ) = 0;
105
106#endif
107
108 ///
109 /// send this object
110 ///
111 virtual void send(
112 ParaComm *comm, ///< communicator used
113 int destination, ///< destination rank
114 int tag ///< TagTerminated
115 ) = 0;
116
117 ///
118 /// receive this object
119 ///
120 virtual void receive(
121 ParaComm *comm, ///< communicator used
122 int source, ///< source rank
123 int tag ///< TagTerminated
124 ) = 0;
125
126};
127
128}
129
130#endif // __PARA_SOLVER_TERMINATION_STATE_H__
131
Base class of communicator object.
Definition: paraComm.h:102
Class for initiator.
Definition: paraInitiator.h:63
class ParaSolverTerminationState (Solver termination state in a ParaSolver)
virtual void send(ParaComm *comm, int destination, int tag)=0
send this object
virtual bool read(ParaComm *comm, gzstream::igzstream &in)=0
read ParaSolverTerminationState from checkpoint file
virtual int getInterruptedMode()=0
getter of interrupted flag
virtual void write(gzstream::ogzstream &out)=0
write ParaSolverTerminationState to checkpoint file
virtual double getDeterministicTime()=0
getter of deterministic time
virtual std::string toString(ParaInitiator *initiator)=0
stringfy ParaSolverTerminationState object
virtual void receive(ParaComm *comm, int source, int tag)=0
receive this object
static ScipParaCommTh * comm
Definition: fscip.cpp:73
Utilities for handling gzipped input and output streams.
Base class of communicator for UG Framework.
Base class of initiator that maintains original problem and incumbent solution.