Scippy

UG

Ubiquity Generator framework

bbParaCalculationStateTh.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 paraCalculationStateTh.cpp
27  * @brief CalcutationStte object 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 {
45  return new BbParaCalculationStateTh(
46  compTime,
47  rootTime,
48  nSolved,
49  nSent,
61  nRestarts,
62  minIisum,
63  maxIisum,
64  minNii,
65  maxNii,
66  dualBound,
68  );
69 }
70 
71 void
73  ParaComm *comm,
74  int destination,
75  int tag
76  )
77 {
78  DEF_PARA_COMM( commTh, comm);
79 
81  commTh->uTypeSend(createDatatype(), ParaCalculationStateType, destination, tag)
82  );
83 }
84 
85 void
87  ParaComm *comm,
88  int source,
89  int tag
90  )
91 {
92  DEF_PARA_COMM( commTh, comm);
93 
94  BbParaCalculationStateTh *received;
95 
97  commTh->uTypeReceive((void **)&received, ParaCalculationStateType, source, tag)
98  );
99 
100  compTime = received->compTime;
101  rootTime = received->rootTime;
102  nSolved = received->nSolved;
103  nSent = received->nSent;
104  nImprovedIncumbent = received->nImprovedIncumbent;
105  terminationState = received->terminationState;
106  nSolvedWithNoPreprocesses = received->nSolvedWithNoPreprocesses;
107  nSimplexIterRoot = received->nSimplexIterRoot;
108  averageSimplexIter = received->averageSimplexIter;
109  nTransferredLocalCuts = received->nTransferredLocalCuts;
110  minTransferredLocalCuts = received->nTransferredLocalCuts;
111  maxTransferredLocalCuts = received->maxTransferredLocalCuts;
112  nTransferredBendersCuts = received->nTransferredBendersCuts;
113  minTransferredBendersCuts = received->nTransferredBendersCuts;
114  maxTransferredBendersCuts = received->maxTransferredBendersCuts;
115  nRestarts = received->nRestarts;
116  minIisum = received->minIisum;
117  maxIisum = received->maxIisum;
118  minNii = received->minNii;
119  maxNii = received->maxNii;
120  dualBound = received->dualBound;
121  nSelfSplitNodesLeft = received->nSelfSplitNodesLeft;
122 
123  delete received;
124 
125 }
double averageSimplexIter
average number of simplex iteration except root node
int nTransferredLocalCuts
number of local cuts transferred from a ParaNode
static const int ParaCalculationStateType
int nSolvedWithNoPreprocesses
number of nodes solved when it is solved with no preprocesses
static ScipParaCommTh * comm
Definition: fscip.cpp:73
BbParaCalculationStateTh * createDatatype()
create thread object datatype of this object
int minTransferredBendersCuts
minimum number of benders cuts transferred from a ParaNode
double maxIisum
maximum sum of integer infeasibility
int nSimplexIterRoot
number of simplex iteration at root node
double minIisum
minimum sum of integer infeasibility
double compTime
computation time of this ParaTask
int nSolved
the number of tasks solved
int minTransferredLocalCuts
minimum number of local cuts transferred from a ParaNode
void send(ParaComm *comm, int destination, int tag)
send this object to destination
#define PARA_COMM_CALL(paracommcall)
Definition: paraComm.h:47
int minNii
minimum number of integer infeasibility
int nRestarts
number of restarts
int terminationState
indicate whether if this computation is terminationState or not. 0: no, 1: terminationState meaning c...
void receive(ParaComm *comm, int source, int tag)
receive this object from source
int maxTransferredLocalCuts
maximum number of local cuts transferred from a ParaNode
#define DEF_PARA_COMM(para_comm, comm)
double rootTime
computation time of the root node
int nSent
the number of ParaNodes sent
Calculation state object for thread communications.
double dualBound
final dual bound value
BbParaCalculationStateTh()
default constructor of this object
int nImprovedIncumbent
the number of improved solution generated in this ParaSolver
int nSelfSplitNodesLeft
number of self-split nodes left
int maxNii
maximum number of integer infeasibility
int nTransferredBendersCuts
number of benders cuts transferred from a ParaNode
int maxTransferredBendersCuts
maximum number of benders cuts transferred from a ParaNode
Base class of communicator object.
Definition: paraComm.h:101