Scippy

UG

Ubiquity Generator framework

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