Scippy

UG

Ubiquity Generator framework

bbParaSolverTerminationStateTh.cpp
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 paraSolverTerminationStateTh.cpp
27  * @brief BbParaSolverTerminationState 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 #include "bbParaComm.h"
38 
39 using namespace UG;
40 
43  )
44 {
47  rank,
49  minNSolved,
50  maxNSolved,
51  totalNSent,
66  nTightened,
79  detTime
80  );
81 
82 }
83 
84 void
86  ParaComm *comm,
87  int destination,
88  int tag
89  )
90 {
91  DEF_PARA_COMM( commTh, comm);
92 
94  commTh->uTypeSend((void *)createDatatype(), ParaSolverTerminationStateType, destination, tag)
95  );
96 }
97 
98 void
100  ParaComm *comm,
101  int source,
102  int tag
103  )
104 {
105  DEF_PARA_COMM( commTh, comm);
106 
109  commTh->uTypeReceive((void **)&received, ParaSolverTerminationStateType, source, tag)
110  );
111  interrupted = received->interrupted;
112  rank = received->rank;
113  totalNSolved = received->totalNSolved;
114  minNSolved = received->minNSolved;
115  maxNSolved = received->maxNSolved;
116  totalNSent = received->totalNSent;
117  totalNImprovedIncumbent = received->totalNImprovedIncumbent;
118  nParaTasksReceived = received->nParaTasksReceived;
119  nParaTasksSolved = received->nParaTasksSolved;
120  nParaNodesSolvedAtRoot = received->nParaNodesSolvedAtRoot;
121  nParaNodesSolvedAtPreCheck = received->nParaNodesSolvedAtPreCheck;
122  nTransferredLocalCutsFromSolver = received->nTransferredLocalCutsFromSolver;
123  minTransferredLocalCutsFromSolver= received->minTransferredLocalCutsFromSolver;
124  maxTransferredLocalCutsFromSolver= received->maxTransferredLocalCutsFromSolver;
125  nTransferredBendersCutsFromSolver = received->nTransferredBendersCutsFromSolver;
126  minTransferredBendersCutsFromSolver= received->minTransferredBendersCutsFromSolver;
127  maxTransferredBendersCutsFromSolver= received->maxTransferredBendersCutsFromSolver;
128  nTotalRestarts= received->nTotalRestarts;
129  minRestarts= received->minRestarts;
130  maxRestarts= received->maxRestarts;
131  nTightened = received->nTightened;
132  nTightenedInt = received->nTightenedInt;
133  calcTerminationState = received->calcTerminationState;
134  runningTime = received->runningTime;
135  idleTimeToFirstParaTask = received->idleTimeToFirstParaTask;
136  idleTimeBetweenParaTasks = received->idleTimeBetweenParaTasks;
137  idleTimeAfterLastParaTask = received->idleTimeAfterLastParaTask;
138  idleTimeToWaitNotificationId = received->idleTimeToWaitNotificationId;
139  idleTimeToWaitAckCompletion = received->idleTimeToWaitAckCompletion;
140  idleTimeToWaitToken = received->idleTimeToWaitToken;
141  totalRootNodeTime = received->totalRootNodeTime;
142  minRootNodeTime = received->minRootNodeTime;
143  maxRootNodeTime = received->maxRootNodeTime;
144  detTime = received->detTime;
145 
146  delete received;
147 }
int interrupted
indicate that this solver is interrupted or not. 0: not interrupted, 1: interrupted, 2: checkpoint, 3: racing-ramp up
BbParaSolverTerminationStateTh * createDatatype()
create BbParaSolverTerminationStateTh datatype
int nTightened
number of tightened variable bounds during racing stage
double maxRootNodeTime
maximum time consumed by root node processes
int nParaNodesSolvedAtPreCheck
number of ParaNodes solved at pre-checking of root node solvability
static ScipParaCommTh * comm
Definition: fscip.cpp:73
int nTotalRestarts
number of total restarts
int nTransferredBendersCutsFromSolver
number of benders cuts transferred from this Solver
int totalNImprovedIncumbent
accumulated number of improvements of incumbent value in this ParaSolver
int rank
rank of this solver Counters related to this ParaSolver
int maxRestarts
maximum number of restarts
int maxTransferredLocalCutsFromSolver
maximum number of local cuts transferred from this Solver
int nParaTasksReceived
number of ParaTasks received in this ParaSolver
int nParaTasksSolved
number of ParaTasks solved ( received ) in this ParaSolvere times of this solver
#define PARA_COMM_CALL(paracommcall)
Definition: paraComm.h:47
double idleTimeToWaitAckCompletion
idle time to wait ack completion message
double idleTimeToFirstParaTask
idle time to start solving the first ParaTask
void send(ParaComm *comm, int destination, int tag)
send this object
int nTightenedInt
number of tightened integral variable bounds during racing stage
int minRestarts
minimum number of restarts
int maxTransferredBendersCutsFromSolver
maximum number of benders cuts transferred from this Solver
double idleTimeAfterLastParaTask
idle time after the last ParaTask was solved
int minTransferredBendersCutsFromSolver
minimum number of benders cuts transferred from this Solver
#define DEF_PARA_COMM(para_comm, comm)
double runningTime
this solver running time
int minTransferredLocalCutsFromSolver
minimum number of local cuts transferred from this Solver
static const int ParaSolverTerminationStateType
int totalNSent
accumulated number of nodes sent from this ParaSolver
int totalNSolved
Counters related to this ParaSolver
int maxNSolved
maximum number of subtree nodes rooted from ParaNode
double idleTimeToWaitNotificationId
idle time to wait notification Id messages
int minNSolved
minimum number of subtree nodes rooted from ParaNode
int nTransferredLocalCutsFromSolver
number of local cuts transferred from this Solver
double totalRootNodeTime
total time consumed by root node processes
int calcTerminationState
termination sate of a calculation in a Solver times for root node process
double minRootNodeTime
minimum time consumed by root node processes
int nParaNodesSolvedAtRoot
number of ParaNodes solved at root node before sending
void receive(ParaComm *comm, int source, int tag)
receive this object
double detTime
deterministic time, -1: should be non-deterministic
double idleTimeToWaitToken
idle time to wait token times for root task process
Base class of communicator object.
Definition: paraComm.h:101
class BbParaSolverTerminationStateMpi (Solver termination state in a ParaSolver communicated by threa...
double idleTimeBetweenParaTasks
idle time between ParaTasks processing