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-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 bbParaSolverStateTh.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
42namespace 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
58public:
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 /// destructor
90 ///
92 )
93 {
94 }
95
96 ///
97 /// send this object
98 ///
99 void send(
100 ParaComm *comm, ///< communicator used
101 int destination, ///< destination rank
102 int tag ///< TagSolverState
103 );
104
105 ///
106 /// receive this object
107 ///
108 void receive(
109 ParaComm *comm, ///< communicator used
110 int source, ///< source rank
111 int tag ///< TagSolverState
112 );
113
114};
115
116#define DEF_PARA_SOLVER_STATE( para_state, state ) BbParaSolverStateTh *para_state = dynamic_cast< BbParaSolverStateTh* >(state)
117
118}
119
120#endif // __BB_PARA_SOLVER_STATE_TH_H__
121
This class has solver state to be transferred.
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
void send(ParaComm *comm, int destination, int tag)
send this object
BbParaSolverStateTh()
default constructor
void receive(ParaComm *comm, int source, int tag)
receive this object
BbParaSolverStateTh * createDatatype()
create BbParaSolverStateTh datatype
class BbParaSolverState (ParaSolver state object for notification message)
Base class of communicator object.
Definition: paraComm.h:102
static ScipParaCommTh * comm
Definition: fscip.cpp:73