1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the program and library */ 4 /* SCIP --- Solving Constraint Integer Programs */ 5 /* */ 6 /* Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB) */ 7 /* */ 8 /* Licensed under the Apache License, Version 2.0 (the "License"); */ 9 /* you may not use this file except in compliance with the License. */ 10 /* You may obtain a copy of the License at */ 11 /* */ 12 /* http://www.apache.org/licenses/LICENSE-2.0 */ 13 /* */ 14 /* Unless required by applicable law or agreed to in writing, software */ 15 /* distributed under the License is distributed on an "AS IS" BASIS, */ 16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 17 /* See the License for the specific language governing permissions and */ 18 /* limitations under the License. */ 19 /* */ 20 /* You should have received a copy of the Apache-2.0 license */ 21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */ 22 /* */ 23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 25 /**@file struct_concsolver.h 26 * @ingroup INTERNALAPI 27 * @brief datastructures for concurrent solvers 28 * @author Leona Gottwald 29 */ 30 31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 32 33 #ifndef __SCIP_STRUCT_CONCSOLVER_H__ 34 #define __SCIP_STRUCT_CONCSOLVER_H__ 35 36 37 #include "scip/def.h" 38 #include "scip/type_concsolver.h" 39 #include "scip/type_clock.h" 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 /** concurrent solver data structure */ 46 struct SCIP_ConcSolverType 47 { 48 int ninstances; /**< number of instances created from this concurrent solver type */ 49 SCIP_Real prefprio; /**< the weight of the concurrent */ 50 char* name; /**< name of concurrent solver */ 51 SCIP_CONCSOLVERTYPEDATA* data; /**< user data of concurrent solver type */ 52 SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)); /**< creates an instance of the concurrent solver */ 53 SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)); /**< destroys an instance of the concurrent solver */ 54 SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)); /**< initialize random seeds of concurrent solver */ 55 SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)); /**< execution method of concurrent solver */ 56 SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata));/**< copies the solving data */ 57 SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)); /**< terminate solving in concurrent solver */ 58 SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)); /**< synchronization method of concurrent solver for sharing it's data */ 59 SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)); /**< synchronization method of concurrent solver for reading shared data */ 60 SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata));/**< frees user data of concurrent solver type */ 61 }; 62 63 /** concurrent solver data structure */ 64 struct SCIP_ConcSolver 65 { 66 SCIP_CONCSOLVERTYPE* type; /**< type of this concurrent solver */ 67 int idx; /**< index of initialized exernal solver */ 68 char* name; /**< name of concurrent solver */ 69 SCIP_CONCSOLVERDATA* data; /**< user data of concurrent solver */ 70 SCIP_SYNCDATA* syncdata; /**< most recent synchronization data that has been read */ 71 SCIP_Longint nsyncs; /**< total number of synchronizations */ 72 SCIP_Real timesincelastsync; /**< time since the last synchronization */ 73 SCIP_Real syncdelay; /**< current delay of synchronization data */ 74 SCIP_Real syncfreq; /**< current synchronization frequency of the concurrent solver */ 75 SCIP_Real solvingtime; /**< solving time with wall clock */ 76 SCIP_Bool stopped; /**< flag to store if the concurrent solver has been stopped 77 * through the SCIPconcsolverStop function */ 78 SCIP_Longint nlpiterations; /**< number of lp iterations the concurrent solver used */ 79 SCIP_Longint nnodes; /**< number of nodes the concurrent solver used */ 80 SCIP_Longint nsolsrecvd; /**< number of solutions the concurrent solver received */ 81 SCIP_Longint nsolsshared; /**< number of solutions the concurrent solver found */ 82 SCIP_Longint ntighterbnds; /**< number of tighter global variable bounds the concurrent solver received */ 83 SCIP_Longint ntighterintbnds; /**< number of tighter global variable bounds the concurrent solver received 84 * on integer variables */ 85 SCIP_CLOCK* totalsynctime; /**< total time used for synchronization, including idle time */ 86 }; 87 88 #ifdef __cplusplus 89 } 90 #endif 91 92 #endif 93