Scippy

UG

Ubiquity Generator framework

scipParaSolutionMpi.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 scipParaSolutionMpi.h
27 * @brief ScipParaSolution 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 __SCIP_PARA_SOLUTION_MPI_H__
38#define __SCIP_PARA_SOLUTION_MPI_H__
39
40#include <mpi.h>
41#include "scipParaTagDef.h"
42#include "scipParaSolution.h"
43#include "scipParaSolver.h"
44
45namespace ParaSCIP
46{
47
48/** ScipSolution class */
50{
51 /** create scipSolutionPreDatatype */
52 MPI_Datatype createPreDatatype();
53 /** create scipSolutionDatatype */
54 MPI_Datatype createDatatype(bool memAllocNecessary);
55
56public:
57
58 /** default constructor */
60 )
61 {
62 }
63
64 /** constructor */
66 ScipParaSolver *solver,
67 SCIP_Real objval,
68 int inNvars,
69 SCIP_VAR ** vars,
70 SCIP_Real * vals
71 )
72 : ScipParaSolution(solver, objval, inNvars, vars, vals){}
73
74 /** constructor */
76 double inObjectiveFunctionValue, /**< objective function value */
77 int inNVars, /**< number of variables */
78 int *inIndicesAmongSolvers, /**< array of variable indices ( probindex ) */
79 SCIP_Real *inValues /**< array of bounds which the branchings */
80 ): ScipParaSolution(inObjectiveFunctionValue, inNVars, inIndicesAmongSolvers, inValues) {}
81
82 /** destructor */
84 )
85 {
86 }
87
88 /** create clone of this object */
90
91 /** broadcast solution data to from the root rank */
92 void bcast(UG::ParaComm *comm, int root);
93
94 /** send solution data to the rank */
95 void send(UG::ParaComm *comm, int destination);
96
97 /** receive solution data from the source rank */
98 void receive(UG::ParaComm *comm, int source);
99
100};
101
103
104}
105
106#endif // __SCIP_PARA_SOLUTION_MPI_H__
107
ScipParaSolutionMpi(double inObjectiveFunctionValue, int inNVars, int *inIndicesAmongSolvers, SCIP_Real *inValues)
ScipParaSolutionMpi(ScipParaSolver *solver, SCIP_Real objval, int inNvars, SCIP_VAR **vars, SCIP_Real *vals)
MPI_Datatype createDatatype(bool memAllocNecessary)
void send(UG::ParaComm *comm, int destination)
void bcast(UG::ParaComm *comm, int root)
void receive(UG::ParaComm *comm, int source)
ScipParaSolutionMpi * clone(UG::ParaComm *comm)
Base class of communicator object.
Definition: paraComm.h:102
static ScipParaCommTh * comm
Definition: fscip.cpp:73
ScipParaSolutionMpi * ScipParaSolutionMpiPtr
ParaSolution extension for SCIP solver.
ParaSolver extension for SCIP: Parallelized solver implementation for SCIP.