Scippy

UG

Ubiquity Generator framework

bbParaLoadCoordinatorTerminationState.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 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 paraLoadCoordinatorTerminationState.h
27  * @brief Load coordinator termination 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 __BB_PARA_LOADCOORDINATOR_TERMINATION_STATE_H__
38 #define __BB_PARA_LOADCOORDINATOR_TERMINATION_STATE_H__
39 
40 #include <string>
41 #include <cfloat>
42 #include "ug/paraComm.h"
44 
45 #ifdef UG_WITH_ZLIB
46 #include "ug/gzstream.h"
47 #endif
48 
49 namespace UG
50 {
51 
52 ///
53 /// Class for LoadCoordinator termination state
54 /// which contains calculation state in a ParaLoadCoordinator
55 ///
57 {
58 public:
59 
60  // bool isCheckpointState; ///< indicate if this state is at checkpoint or not
61  // int rank; ///< rank of this ParaLoadCoordinator
62  ///
63  /// Counters related to this ParaLoadCoordinator
64  /// TODO: The numbers should be classified depending on solvers
65  ///
66  unsigned long long nSentBackImmediately; ///< number of ParaNodes sent back immediately from LC
67  unsigned long long nSentBackImmediatelyAnotherNode; ///< number of ParaNodes sent back immediately after AnotherNode request from LC
68  unsigned long long nDeletedInLc; ///< number of ParaNodes deleted in LC
69  unsigned long long nDeletedByMerging; ///< number of ParaNodes deleted by merging
70  unsigned long long nFailedToSendBack; ///< number of ParaNodes failed to send back
71  unsigned long long nFailedToSendBackAnotherNode; ///< number of ParaNodes failed to send back after AnotherNode request
72  unsigned long long nMaxUsageOfNodePool; ///< maximum number of ParaNodes in ParaNodePool
73  unsigned long long nInitialP; ///< initial p value, which indicates the number of good ParaNodes try to keep in LC
74  unsigned long long mMaxCollectingNodes; ///< maximum multiplier for the number of collecting nodes
75  unsigned long long nNodesInNodePool; ///< number of nodes in ParaNodePool
76  unsigned long long nNodesLeftInAllSolvers; ///< number of nodes left in all Solvers
77  unsigned long long nNodesOutputLog; ///< count for next logging of the number of transferred ParaNodes
78  double tNodesOutputLog; ///< keep time for next logging of the number of transferred ParaNodes
79  ///
80  /// current dual bound value
81  ///
82  double globalBestDualBoundValue; ///< global best dual bound value (internal value)
83  double externalGlobalBestDualBoundValue; ///< global best dual bound value (external value)
84  ///
85  /// times of this LoadCoordinator
86  ///
87  double idleTime; ///< idle time of this LoadCoordinator
88  double runningTime; ///< this ParaLoadCoordinator running time
89  ///
90  /// times used for merging
91  ///
92  double addingNodeToMergeStructTime; ///< time when a ParaNode is added to merge struct
93  double generateMergeNodesCandidatesTime; ///< time when merge ParaNode candidates are generated
94  double regenerateMergeNodesCandidatesTime; ///< time when merge ParaNode candidates are regenerated
95  double mergeNodeTime; ///< time when ParaNode is merged
96 
97 
98  ///
99  /// default constructor
100  ///
102  )
104  nSentBackImmediately(0),
105  nSentBackImmediatelyAnotherNode(0),
106  nDeletedInLc(0),
107  nDeletedByMerging(0),
108  nFailedToSendBack(0),
109  nFailedToSendBackAnotherNode(0),
110  nMaxUsageOfNodePool(0),
111  nInitialP(0),
112  mMaxCollectingNodes(0),
113  nNodesInNodePool(0),
114  nNodesLeftInAllSolvers(0),
115  nNodesOutputLog(0),
116  tNodesOutputLog(0.0),
117  globalBestDualBoundValue(-DBL_MAX),
118  externalGlobalBestDualBoundValue(-DBL_MAX),
119  idleTime(0.0),
120  runningTime(0.0),
121  addingNodeToMergeStructTime(0.0),
122  generateMergeNodesCandidatesTime(0.0),
123  regenerateMergeNodesCandidatesTime(0.0),
124  mergeNodeTime(0.0)
125  {
126  }
127 
128  ///
129  /// destructor
130  ///
132  )
133  {
134  }
135 
136  ///
137  /// stringfy ParaCalculationState
138  /// @return string to show inside of this object
139  ///
140  std::string toString(
141  );
142 
143 #ifdef UG_WITH_ZLIB
144 
145  ///
146  /// write to checkpoint file
147  ///
148  void write(
149  gzstream::ogzstream &out ///< gzstream for output
150  );
151 
152  ///
153  /// read from checkpoint file
154  ///
155  bool read(
156  ParaComm *comm, ///< communicator used
157  gzstream::igzstream &in ///< gzstream for input
158  );
159 
160 #endif
161 
162 };
163 
164 }
165 
166 #endif // __BB_PARA_LOADCOORDINATOR_TERMINATION_STATE_H__
167 
double generateMergeNodesCandidatesTime
time when merge ParaNode candidates are generated
std::string toString()
stringfy ParaCalculationState
static ScipParaCommTh * comm
Definition: fscip.cpp:73
Class for LoadCoordinator termination state which contains calculation state in a ParaLoadCoordinator...
double tNodesOutputLog
keep time for next logging of the number of transferred ParaNodes
unsigned long long nSentBackImmediately
Counters related to this ParaLoadCoordinator TODO: The numbers should be classified depending on solv...
unsigned long long nDeletedInLc
number of ParaNodes deleted in LC
double regenerateMergeNodesCandidatesTime
time when merge ParaNode candidates are regenerated
unsigned long long nFailedToSendBackAnotherNode
number of ParaNodes failed to send back after AnotherNode request
double addingNodeToMergeStructTime
time when a ParaNode is added to merge struct
double runningTime
this ParaLoadCoordinator running time
unsigned long long nNodesOutputLog
count for next logging of the number of transferred ParaNodes
double externalGlobalBestDualBoundValue
global best dual bound value (external value)
unsigned long long nNodesInNodePool
number of nodes in ParaNodePool
double globalBestDualBoundValue
global best dual bound value (internal value)
unsigned long long nFailedToSendBack
number of ParaNodes failed to send back
unsigned long long nMaxUsageOfNodePool
maximum number of ParaNodes in ParaNodePool
Load coordinator termination state.
Base class of communicator for UG Framework.
void read(ParaComm *comm, const char *filename)
read ParaParams from file
unsigned long long nNodesLeftInAllSolvers
number of nodes left in all Solvers
Class for LoadCoordinator termination state which contains calculation state in a ParaLoadCoordinator...
unsigned long long mMaxCollectingNodes
maximum multiplier for the number of collecting nodes
unsigned long long nDeletedByMerging
number of ParaNodes deleted by merging
unsigned long long nInitialP
initial p value, which indicates the number of good ParaNodes try to keep in LC
unsigned long long nSentBackImmediatelyAnotherNode
number of ParaNodes sent back immediately after AnotherNode request from LC
Base class of communicator object.
Definition: paraComm.h:101