Scippy

UG

Ubiquity Generator framework

bbParaSolverStateTh.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 paraSolverStateTh.h
27  * @brief BbParaSolverState extension for threads communication.
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_SOLVER_STATE_TH_H__
38 #define __BB_PARA_SOLVER_STATE_TH_H__
39 
40 #include "bbParaSolverState.h"
41 
42 namespace UG
43 {
44 
45 ///
46 /// class BbParaSolverStateTh
47 /// (ParaSolver state object for notification message by thread communication)
48 ///
50 {
51  ///
52  /// create BbParaSolverStateTh datatype
53  /// @return BbParaSolverStateTh dataype
54  ///
56  );
57 
58 public:
59 
60  ///
61  /// default constructor
62  ///
64  )
65  {
66  }
67 
68  ///
69  /// constructor
70  ///
72  int inRacingStage, ///< indicate if Solver is in racing stage or not
73  unsigned int inNotificationId, ///< id for this notification
74  int inLcId, ///< lc id of current ParaNode
75  int inGlobalSubtreeId, ///< global subtree id of current ParaNode
76  long long inNodesSolved, ///< number of nodes solved
77  int inNodesLeft, ///< number of remaining nodes
78  double inBestDualBoundValue, ///< best dual bound value in that of remaining nodes
79  double inGlobalBestPrimalBoundValue, ///< global best primal bound value
80  double inDetTime, ///< deterministic time, -1: should be non-deterministic
81  double inAverageDualBoundGain ///< average dual bound gain received
82  )
83  : BbParaSolverState(inRacingStage, inNotificationId, inLcId, inGlobalSubtreeId,
84  inNodesSolved, inNodesLeft, inBestDualBoundValue, inGlobalBestPrimalBoundValue, inDetTime, inAverageDualBoundGain)
85  {
86  }
87 
88  ///
89  /// destractor
90  ///
92  )
93  {
94  }
95 
96  ///
97  /// send this object
98  /// @return always 0 (for future extensions)
99  ///
100  void send(
101  ParaComm *comm, ///< communicator used
102  int destination, ///< destination rank
103  int tag ///< TagSolverState
104  );
105 
106  ///
107  /// receive this object
108  /// @return always 0 (for future extensions)
109  ///
110  void receive(
111  ParaComm *comm, ///< communicator used
112  int source, ///< source rank
113  int tag ///< TagSolverState
114  );
115 
116 };
117 
118 #define DEF_PARA_SOLVER_STATE( para_state, state ) BbParaSolverStateTh *para_state = dynamic_cast< BbParaSolverStateTh* >(state)
119 
120 }
121 
122 #endif // __BB_PARA_SOLVER_STATE_TH_H__
123 
void send(ParaComm *comm, int destination, int tag)
send this object
static ScipParaCommTh * comm
Definition: fscip.cpp:73
void receive(ParaComm *comm, int source, int tag)
receive this object
class BbParaSolverStateTh (ParaSolver state object for notification message by thread communication) ...
BbParaSolverStateTh(int inRacingStage, unsigned int inNotificationId, int inLcId, int inGlobalSubtreeId, long long inNodesSolved, int inNodesLeft, double inBestDualBoundValue, double inGlobalBestPrimalBoundValue, double inDetTime, double inAverageDualBoundGain)
constructor
class BbParaSolverState (ParaSolver state object for notification message)
BbParaSolverStateTh * createDatatype()
create BbParaSolverStateTh datatype
BbParaSolverStateTh()
default constructor
Base class of communicator object.
Definition: paraComm.h:101