Scippy

UG

Ubiquity Generator framework

bbParaCalculationStateMpi.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 bbParaCalculationStateMpi.h
27 * @brief CalcutationStte object 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_CALCULATION_STATE_MPI_H__
38#define __BB_PARA_CALCULATION_STATE_MPI_H__
39
40#include <mpi.h>
41#include "bbParaCommMpi.h"
43
44namespace UG
45{
46
47///
48/// Calculation state object for MPI communications
49///
51{
52
53 ///
54 /// create MPI datatype of this object
55 /// @return MPI dataypte of this object
56 ///
57 MPI_Datatype createDatatype(
58 );
59
60public:
61
62 ///
63 /// default constructor of this object
64 ///
66 )
67 {
68 }
69
70 ///
71 /// constructor of this object
72 ///
74 double inCompTime, ///< computation time of this ParaNode
75 double inRootTime, ///< computation time of the root node
76 int inNSolved, ///< the number of nodes solved
77 int inNSent, ///< the number of ParaNodes sent
78 int inNImprovedIncumbent, ///< the number of improved solution generated in this ParaSolver
79 int inTerminationState, ///< indicate whether if this computation is terminationState or not. 0: no, 1: terminationState
80 int inNSolvedWithNoPreprocesses, ///< number of nodes solved when it is solved with no preprocesses
81 int inNSimplexIterRoot, ///< number of simplex iteration at root node
82 double inAverageSimplexIter, ///< average number of simplex iteration except root node
83 int inNTransferredLocalCuts, ///< number of local cuts transferred from a ParaNode
84 int inMinTransferredLocalCuts, ///< minimum number of local cuts transferred from a ParaNode
85 int inMaxTransferredLocalCuts, ///< maximum number of local cuts transferred from a ParaNode
86 int inNTransferredBendersCuts, ///< number of benders cuts transferred from a ParaNode
87 int inMinTransferredBendersCuts, ///< minimum number of benders cuts transferred from a ParaNode
88 int inMaxTransferredBendersCuts, ///< maximum number of benders cuts transferred from a ParaNode
89 int inNRestarts, ///< number of restarts
90 double inMinIisum, ///< minimum sum of integer infeasibility
91 double inMaxIisum, ///< maximum sum of integer infeasibility
92 int inMinNii, ///< minimum number of integer infeasibility
93 int inMaxNii, ///< maximum number of integer infeasibility
94 double inDualBound, ///< final dual Bound value
95 int inNSelfSplitNodesLeft ///< number of self-split nodes left
96 )
97 : BbParaCalculationState(inCompTime,inRootTime, inNSolved, inNSent,inNImprovedIncumbent,inTerminationState,inNSolvedWithNoPreprocesses,
98 inNSimplexIterRoot, inAverageSimplexIter,
99 inNTransferredLocalCuts, inMinTransferredLocalCuts, inMaxTransferredLocalCuts,
100 inNTransferredBendersCuts, inMinTransferredBendersCuts, inMaxTransferredBendersCuts,
101 inNRestarts, inMinIisum, inMaxIisum, inMinNii, inMaxNii, inDualBound, inNSelfSplitNodesLeft )
102 {
103 }
104
105 ///
106 /// destructor of this object
107 ///
109 )
110 {
111 }
112
113 ///
114 /// send this object to destination
115 ///
116 void send(
117 ParaComm *comm, ///< communicator used to send this object
118 int destination, ///< destination rank to send
119 int tag ///< tag to show this object
120 );
121
122 ///
123 /// receive this object from source
124 ///
125 void receive(
126 ParaComm *comm, ///< communicator used to receive this object
127 int source, ///< source rank to receive this object
128 int tag ///< tag to show this object
129 );
130
131};
132
133}
134
135#endif // __BB_PARA_CALCULATION_STATE_MPI_H__
136
Base class for calculation state.
ParaComm extension for MPI communication.
Calculation state object for MPI communications.
void send(ParaComm *comm, int destination, int tag)
send this object to destination
BbParaCalculationStateMpi()
default constructor of this object
MPI_Datatype createDatatype()
create MPI datatype of this object
~BbParaCalculationStateMpi()
destructor of this object
BbParaCalculationStateMpi(double inCompTime, double inRootTime, int inNSolved, int inNSent, int inNImprovedIncumbent, int inTerminationState, int inNSolvedWithNoPreprocesses, int inNSimplexIterRoot, double inAverageSimplexIter, int inNTransferredLocalCuts, int inMinTransferredLocalCuts, int inMaxTransferredLocalCuts, int inNTransferredBendersCuts, int inMinTransferredBendersCuts, int inMaxTransferredBendersCuts, int inNRestarts, double inMinIisum, double inMaxIisum, int inMinNii, int inMaxNii, double inDualBound, int inNSelfSplitNodesLeft)
constructor of this object
void receive(ParaComm *comm, int source, int tag)
receive this object from source
Base class of Calculation state in a ParaSolver.
Base class of communicator object.
Definition: paraComm.h:102
static ScipParaCommTh * comm
Definition: fscip.cpp:73