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-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 bbParaSolverTerminationStateMpi.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
44namespace 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
61public:
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 ///
154 void send(
155 ParaComm *comm, ///< communicator used
156 int destination, ///< destination rank
157 int tag ///< TagTerminated
158 );
159
160 ///
161 /// receive this object
162 ///
163 void receive(
164 ParaComm *comm, ///< communicator used
165 int source, ///< source rank
166 int tag ///< TagTerminated
167 );
168
169};
170
171}
172
173#endif // __BB_PARA_SOLVER_TERMINATION_STATE_MPI_H__
174
ParaComm extension for MPI communication.
This class contains solver termination state which is transferred form Solver to LC.
class BbParaSolverTerminationStateMpi (Solver termination state in a ParaSolver communicated by MPI)
void send(ParaComm *comm, int destination, int tag)
send this object
MPI_Datatype createDatatype()
create BbParaSolverTerminationStateMpi datatype
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
void receive(ParaComm *comm, int source, int tag)
receive this object
class BbParaSolverTerminationState (Solver termination state in a ParaSolver)
Base class of communicator object.
Definition: paraComm.h:102
static ScipParaCommTh * comm
Definition: fscip.cpp:73