Scippy

UG

Ubiquity Generator framework

bbParaSolverTerminationStateMpi.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 paraSolverTerminationStateMpi.h
27  * @brief BbParaSolverTerminationState extension for MIP 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_TERMINATION_STATE_MPI_H__
38 #define __BB_PARA_SOLVER_TERMINATION_STATE_MPI_H__
39 
40 #include <mpi.h>
41 #include "bbParaCommMpi.h"
43 
44 namespace UG
45 {
46 
47 ///
48 /// class BbParaSolverTerminationStateMpi
49 /// (Solver termination state in a ParaSolver communicated by MPI)
50 ///
52 {
53 
54  ///
55  /// create BbParaSolverTerminationStateMpi datatype
56  /// @return MPI_Datatype for BbParaSolverTerminationStateMpi
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 inInterrupted, ///< indicate that this solver is interrupted or not.
76  ///< 0: not interrupted,
77  ///< 1: interrupted
78  ///< 2: checkpoint,
79  ///< 3: racing-ramp up
80  int inRank, ///< rank of this solver
81  int inTotalNSolved, ///< accumulated number of nodes solved in this ParaSolver
82  int inMinNSolved, ///< minimum number of subtree nodes rooted from ParaNode
83  int inMaxNSolved, ///< maximum number of subtree nodes rooted from ParaNode
84  int inTotalNSent, ///< accumulated number of nodes sent from this ParaSolver
85  int inTotalNImprovedIncumbent, ///< accumulated number of improvements of incumbent value in this ParaSolver
86  int inNParaNodesReceived, ///< number of ParaNodes received in this ParaSolver
87  int inNParaNodesSolved, ///< number of ParaNodes solved ( received ) in this ParaSolver
88  int inNParaNodesSolvedAtRoot, ///< number of ParaNodes solved at root node before sending
89  int inNParaNodesSolvedAtPreCheck, ///< number of ParaNodes solved at pre-checking of root node solvability
90  int inNTransferredLocalCutsFromSolver, ///< number of local cuts transferred from this Solver
91  int inMinTransferredLocalCutsFromSolver, ///< minimum number of local cuts transferred from this Solver
92  int inMaxTransferredLocalCutsFromSolver, ///< maximum number of local cuts transferred from this Solver
93  int inNTransferredBendersCutsFromSolver, ///< number of benders cuts transferred from this Solver
94  int inMinTransferredBendersCutsFromSolver, ///< minimum number of benders cuts transferred from this Solver
95  int inMaxTransferredBendersCutsFromSolver, ///< maximum number of benders cuts transferred from this Solver
96  int inNTotalRestarts, ///< number of total restarts
97  int inMinRestarts, ///< minimum number of restarts
98  int inMaxRestarts, ///< maximum number of restarts
99  int inNTightened, ///< number of tightened variable bounds during racing stage
100  int inNTightenedInt, ///< number of tightened integral variable bounds during racing stage
101  int inCalcTerminationState, ///< termination sate of a calculation in a Solver
102  double inRunningTime, ///< this solver running time
103  double inIdleTimeToFirstParaNode, ///< idle time to start solving the first ParaNode
104  double inIdleTimeBetweenParaNodes, ///< idle time between ParaNodes processing
105  double inIdleTimeAfterLastParaNode, ///< idle time after the last ParaNode was solved
106  double inIdleTimeToWaitNotificationId, ///< idle time to wait notification Id messages
107  double inIdleTimeToWaitAckCompletion, ///< idle time to wait ack completion message
108  double inIdleTimeToWaitToken, ///< idle time to wait token
109  double inTotalRootNodeTime, ///< total time consumed by root node processes
110  double inMinRootNodeTime, ///< minimum time consumed by root node processes
111  double inMaxRootNodeTime, ///< maximum time consumed by root node processes
112  double inDetTime ///< deterministic time, -1: should be non-deterministic
113  )
114  : BbParaSolverTerminationState( inInterrupted,
115  inRank,
116  inTotalNSolved,
117  inMinNSolved,
118  inMaxNSolved,
119  inTotalNSent,
120  inTotalNImprovedIncumbent,
121  inNParaNodesReceived,
122  inNParaNodesSolved,
123  inNParaNodesSolvedAtRoot,
124  inNParaNodesSolvedAtPreCheck,
125  inNTransferredLocalCutsFromSolver,
126  inMinTransferredLocalCutsFromSolver,
127  inMaxTransferredLocalCutsFromSolver,
128  inNTransferredBendersCutsFromSolver,
129  inMinTransferredBendersCutsFromSolver,
130  inMaxTransferredBendersCutsFromSolver,
131  inNTotalRestarts,
132  inMinRestarts,
133  inMaxRestarts,
134  inNTightened,
135  inNTightenedInt,
136  inCalcTerminationState,
137  inRunningTime,
138  inIdleTimeToFirstParaNode,
139  inIdleTimeBetweenParaNodes,
140  inIdleTimeAfterLastParaNode,
141  inIdleTimeToWaitNotificationId,
142  inIdleTimeToWaitAckCompletion,
143  inIdleTimeToWaitToken,
144  inTotalRootNodeTime,
145  inMinRootNodeTime,
146  inMaxRootNodeTime,
147  inDetTime )
148  {
149  }
150 
151  ///
152  /// send this object
153  /// @return always 0 (for future extensions)
154  ///
155  void send(
156  ParaComm *comm, ///< communicator used
157  int destination, ///< destination rank
158  int tag ///< TagTerminated
159  );
160 
161  ///
162  /// receive this object
163  /// @return always 0 (for future extensions)
164  ///
165  void receive(
166  ParaComm *comm, ///< communicator used
167  int source, ///< source rank
168  int tag ///< TagTerminated
169  );
170 
171 };
172 
173 }
174 
175 #endif // __BB_PARA_SOLVER_TERMINATION_STATE_MPI_H__
176 
static ScipParaCommTh * comm
Definition: fscip.cpp:73
class BbParaSolverTerminationStateMpi (Solver termination state in a ParaSolver communicated by MPI) ...
void receive(ParaComm *comm, int source, int tag)
receive this object
void send(ParaComm *comm, int destination, int tag)
send this object
BbParaSolverTerminationStateMpi(int inInterrupted, int inRank, int inTotalNSolved, int inMinNSolved, int inMaxNSolved, int inTotalNSent, int inTotalNImprovedIncumbent, int inNParaNodesReceived, int inNParaNodesSolved, int inNParaNodesSolvedAtRoot, int inNParaNodesSolvedAtPreCheck, int inNTransferredLocalCutsFromSolver, int inMinTransferredLocalCutsFromSolver, int inMaxTransferredLocalCutsFromSolver, int inNTransferredBendersCutsFromSolver, int inMinTransferredBendersCutsFromSolver, int inMaxTransferredBendersCutsFromSolver, int inNTotalRestarts, int inMinRestarts, int inMaxRestarts, int inNTightened, int inNTightenedInt, int inCalcTerminationState, double inRunningTime, double inIdleTimeToFirstParaNode, double inIdleTimeBetweenParaNodes, double inIdleTimeAfterLastParaNode, double inIdleTimeToWaitNotificationId, double inIdleTimeToWaitAckCompletion, double inIdleTimeToWaitToken, double inTotalRootNodeTime, double inMinRootNodeTime, double inMaxRootNodeTime, double inDetTime)
constructor
MPI_Datatype createDatatype()
create BbParaSolverTerminationStateMpi datatype
class BbParaSolverTerminationState (Solver termination state in a ParaSolver)
Base class of communicator object.
Definition: paraComm.h:101