Scippy

UG

Ubiquity Generator framework

scipParaRacingRampUpParamSetTh.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-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 scipParaRacingRampUpParamSetTh.cpp
27 * @brief ScipParaRacingRampUpParamSet 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
37#include "scipParaCommTh.h"
38#include "scipDiffParamSetTh.h"
40#include <cstring>
41
42using namespace ParaSCIP;
43
44/** create Datatype */
46ScipParaRacingRampUpParamSetTh::createDatatype(
47 )
48{
49 ScipDiffParamSetTh *scipDiffParamSetTh = dynamic_cast<ScipDiffParamSetTh *>(scipDiffParamSet);
50
52 {
60 scipDiffParamSetTh->clone()
61 );
62 }
63 else
64 {
72 0
73 );
74 }
75}
76
77int
80 int dest)
81{
82
83 DEF_SCIP_PARA_COMM( commTh, comm);
84
87 );
88
89 return 0;
90
91}
92
93int
96 int source)
97{
98
99 DEF_SCIP_PARA_COMM( commTh, comm);
100
103 commTh->uTypeReceive((void **)&received, UG::ParaRacingRampUpParamType, source, UG::TagRacingRampUpParamSet)
104 );
105
107 nNodesLeft = received->nNodesLeft;
108 timeLimit = received->timeLimit;
114 {
115 ScipDiffParamSetTh *scipDiffParamSetTh = dynamic_cast<ScipDiffParamSetTh *>(received->scipDiffParamSet);
116 scipDiffParamSet = scipDiffParamSetTh->clone();
117 }
118
119 delete received;
120
121 return 0;
122
123}
ScipDiffParamSetTh * clone()
double timeLimit
stop racing time limit
int nNodesLeft
stop racing number of nodes left
Base class of communicator object.
Definition: paraComm.h:102
int terminationCriteria
termination criteria of racing ramp-up : 0: number of nodes left, 1: time limit meaning must be defin...
static ScipParaCommTh * comm
Definition: fscip.cpp:73
static const int TagRacingRampUpParamSet
Definition: paraTagDef.h:59
static const int ParaRacingRampUpParamType
#define PARA_COMM_CALL(paracommcall)
Definition: paraComm.h:47
ScipDiffParamSet extension for threads communication.
#define DEF_SCIP_PARA_COMM(scip_para_comm, comm)
SCIP ParaComm extension for threads communication.
ScipParaRacingRampUpParamSet extension for threads communication.