Scippy

    SCIP

    Solving Constraint Integer Programs

    concurrent.h
    Go to the documentation of this file.
    1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    2/* */
    3/* This file is part of the program and library */
    4/* SCIP --- Solving Constraint Integer Programs */
    5/* */
    6/* Copyright (c) 2002-2025 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 concurrent.h
    26 * @ingroup PARALLEL
    27 * @brief helper functions for concurrent scip solvers
    28 * @author Leona Gottwald
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    34#include "scip/type_scip.h"
    36#include "scip/type_sol.h"
    37#include "scip/type_var.h"
    38#include "scip/type_syncstore.h"
    39#include "scip/type_retcode.h"
    40#include "scip/def.h"
    41
    42#ifndef __SCIP_CONCURRENT_H__
    43#define __SCIP_CONCURRENT_H__
    44
    45#ifdef __cplusplus
    46extern "C" {
    47#endif
    48
    49/** create concurrent data */
    51 SCIP* scip, /**< SCIP datastructure */
    52 SCIP_CONCSOLVER* concsolver, /**< concurrent solver of given SCIP instance */
    53 int* varperm, /**< permutation of variables for communication */
    54 int nvars /**< number of variables in problem */
    55 );
    56
    57/** get number of initialized concurrent solvers */
    59 SCIP* scip /**< SCIP datastructure */
    60 );
    61
    62/** gets the concurrent solvers */
    64 SCIP* scip /**< SCIP datastructure */
    65 );
    66
    67/** adds a concurrent solver */
    69 SCIP* scip, /**< SCIP datastructure */
    70 SCIP_CONCSOLVER* concsolver /**< concurrent solver of given SCIP instance */
    71 );
    72
    73/** frees concurrent data */
    75 SCIP* scip /**< SCIP datastructure */
    76 );
    77
    78/** increments the time counter for synchronization */
    80 SCIP* scip, /**< SCIP datastructure */
    81 SCIP_Real val /**< value by which the time counter for synchronization is incremented */
    82 );
    83
    84/** synchronize with other concurrent solvers */
    86 SCIP* scip /**< SCIP datastructure */
    87 );
    88
    89/** pass a solution to the given SCIP instance using that was received via synchronization by using
    90 * the sync heuristic */
    92 SCIP* scip, /**< SCIP datastructure */
    93 SCIP_SOL* sol /**< solution */
    94 );
    95
    96/** adds a global boundchange to the given SCIP, by passing it to the sync propagator */
    98 SCIP* scip, /**< SCIP data structure */
    99 SCIP_VAR* var, /**< variable for bound */
    100 SCIP_Real val, /**< value of bound */
    101 SCIP_BOUNDTYPE bndtype /**< type of bound */
    102 );
    103
    104/** copy the nodenumber, depth, time, and runnumber of one solution to another one */
    106 SCIP_SOL* source, /**< source for solution statistics */
    107 SCIP_SOL* target /**< target for solution statistics */
    108 );
    109
    110/** copy solving statistics */
    112 SCIP* source, /**< SCIP data structure */
    113 SCIP* target /**< target SCIP data structure */
    114 );
    115
    116/** get variable index of original variable that is the same between concurrent solvers */
    118 SCIP* scip, /**< SCIP data structure */
    119 SCIP_VAR* var /**< variable */
    120 );
    121
    122/** has the solution been created after the last synchronization point */
    124 SCIP* scip, /**< SCIP data structure */
    125 SCIP_SOL* sol /**< the solution */
    126 );
    127
    128/** gets the global bound changes since the last synchronization point */
    130 SCIP* scip /**< SCIP data structure */
    131 );
    132
    133/** start solving in parallel using the given set of concurrent solvers */
    135 SCIP* scip /**< pointer to scip datastructure */
    136 );
    137
    138/** disables storing global bound changes */
    140 SCIP* scip /**< SCIP data structure */
    141 );
    142
    143/** enables storing global bound changes */
    145 SCIP* scip /**< SCIP data structure */
    146 );
    147
    148/** gets total memory usage of all concurrent solvers together */
    150 SCIP* scip /**< SCIP data structure */
    151 );
    152
    153/** gets the dualbound in the last synchronization */
    155 SCIP* scip /**< SCIP data structure */
    156 );
    157
    158/** gets the primalbound in the last synchronization */
    160 SCIP* scip /**< SCIP data structure */
    161 );
    162
    163/** gets the gap in the last synchronization */
    165 SCIP* scip /**< SCIP data structure */
    166 );
    167
    168/** gives the total number of tightened bounds received from other concurrent solvers */
    170 SCIP* scip /**< SCIP data structure */
    171 );
    172
    173/** gives the total number of tightened bounds for integer variables received from
    174 * other concurrent solvers */
    176 SCIP* scip /**< SCIP data structure */
    177 );
    178
    179#ifdef __cplusplus
    180}
    181#endif
    182
    183#endif
    SCIP_Real SCIPgetConcurrentDualbound(SCIP *scip)
    Definition: concurrent.c:317
    SCIP_RETCODE SCIPconcurrentSolve(SCIP *scip)
    Definition: concurrent.c:505
    SCIP_Real SCIPgetConcurrentPrimalbound(SCIP *scip)
    Definition: concurrent.c:332
    SCIP_RETCODE SCIPcreateConcurrent(SCIP *scip, SCIP_CONCSOLVER *concsolver, int *varperm, int nvars)
    Definition: concurrent.c:67
    SCIP_RETCODE SCIPsynchronize(SCIP *scip)
    Definition: concurrent.c:257
    SCIP_RETCODE SCIPincrementConcurrentTime(SCIP *scip, SCIP_Real val)
    Definition: concurrent.c:199
    int SCIPgetConcurrentVaridx(SCIP *scip, SCIP_VAR *var)
    Definition: concurrent.c:434
    SCIP_RETCODE SCIPfreeConcurrent(SCIP *scip)
    Definition: concurrent.c:161
    SCIP_RETCODE SCIPaddConcurrentBndchg(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE bndtype)
    Definition: concurrent.c:398
    SCIP_RETCODE SCIPcopySolStats(SCIP_SOL *source, SCIP_SOL *target)
    Definition: concurrent.c:416
    SCIP_Longint SCIPgetConcurrentMemTotal(SCIP *scip)
    Definition: concurrent.c:299
    SCIP_BOUNDSTORE * SCIPgetConcurrentGlobalBoundChanges(SCIP *scip)
    Definition: concurrent.c:469
    SCIP_RETCODE SCIPaddConcurrentSolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
    Definition: concurrent.c:148
    SCIP_CONCSOLVER ** SCIPgetConcurrentSolvers(SCIP *scip)
    Definition: concurrent.c:137
    SCIP_Bool SCIPIsConcurrentSolNew(SCIP *scip, SCIP_SOL *sol)
    Definition: concurrent.c:456
    SCIP_Longint SCIPgetConcurrentNTightenedBnds(SCIP *scip)
    Definition: concurrent.c:361
    void SCIPenableConcurrentBoundStorage(SCIP *scip)
    Definition: concurrent.c:287
    int SCIPgetNConcurrentSolvers(SCIP *scip)
    Definition: concurrent.c:126
    SCIP_RETCODE SCIPcopyConcurrentSolvingStats(SCIP *source, SCIP *target)
    Definition: concurrent.c:574
    SCIP_RETCODE SCIPaddConcurrentSol(SCIP *scip, SCIP_SOL *sol)
    Definition: concurrent.c:383
    SCIP_Real SCIPgetConcurrentGap(SCIP *scip)
    Definition: concurrent.c:347
    void SCIPdisableConcurrentBoundStorage(SCIP *scip)
    Definition: concurrent.c:275
    SCIP_Longint SCIPgetConcurrentNTightenedIntBnds(SCIP *scip)
    Definition: concurrent.c:372
    common defines and data types used in all packages of SCIP
    #define SCIP_Longint
    Definition: def.h:141
    #define SCIP_Bool
    Definition: def.h:91
    #define SCIP_Real
    Definition: def.h:156
    type definitions for concurrent solvers
    type definition of concurrent data
    enum SCIP_BoundType SCIP_BOUNDTYPE
    Definition: type_lp.h:60
    type definitions for return codes for SCIP methods
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    type definitions for SCIP's main datastructure
    type definitions for storing primal CIP solutions
    the type definitions for the synchronization store
    type definitions for problem variables