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-2026 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 that was received via synchronization by using the sync heuristic */
    91 SCIP* scip, /**< SCIP datastructure */
    92 SCIP_SOL* sol /**< solution */
    93 );
    94
    95/** adds a global boundchange to the given SCIP, by passing it to the sync propagator */
    97 SCIP* scip, /**< SCIP data structure */
    98 SCIP_VAR* var, /**< variable for bound */
    99 SCIP_Real val, /**< value of bound */
    100 SCIP_BOUNDTYPE bndtype /**< type of bound */
    101 );
    102
    103/** copy the nodenumber, depth, time, and runnumber of one solution to another one */
    105 SCIP_SOL* source, /**< source for solution statistics */
    106 SCIP_SOL* target /**< target for solution statistics */
    107 );
    108
    109/** copy solving statistics */
    111 SCIP* source, /**< SCIP data structure */
    112 SCIP* target /**< target SCIP data structure */
    113 );
    114
    115/** get variable index of original variable that is the same between concurrent solvers */
    117 SCIP* scip, /**< SCIP data structure */
    118 SCIP_VAR* var /**< variable */
    119 );
    120
    121/** has the solution been created after the last synchronization point */
    123 SCIP* scip, /**< SCIP data structure */
    124 SCIP_SOL* sol /**< the solution */
    125 );
    126
    127/** gets the global bound changes since the last synchronization point */
    129 SCIP* scip /**< SCIP data structure */
    130 );
    131
    132/** start solving in parallel using the given set of concurrent solvers */
    134 SCIP* scip /**< pointer to scip datastructure */
    135 );
    136
    137/** disables storing global bound changes */
    139 SCIP* scip /**< SCIP data structure */
    140 );
    141
    142/** enables storing global bound changes */
    144 SCIP* scip /**< SCIP data structure */
    145 );
    146
    147/** gets total memory usage of all concurrent solvers together */
    149 SCIP* scip /**< SCIP data structure */
    150 );
    151
    152/** gets the dualbound in the last synchronization */
    154 SCIP* scip /**< SCIP data structure */
    155 );
    156
    157/** gets the primalbound in the last synchronization */
    159 SCIP* scip /**< SCIP data structure */
    160 );
    161
    162/** gets the gap in the last synchronization */
    164 SCIP* scip /**< SCIP data structure */
    165 );
    166
    167/** gives the total number of tightened bounds received from other concurrent solvers */
    169 SCIP* scip /**< SCIP data structure */
    170 );
    171
    172/** gives the total number of tightened bounds for integer variables received from
    173 * other concurrent solvers */
    175 SCIP* scip /**< SCIP data structure */
    176 );
    177
    178#ifdef __cplusplus
    179}
    180#endif
    181
    182#endif
    SCIP_Real SCIPgetConcurrentDualbound(SCIP *scip)
    Definition: concurrent.c:318
    SCIP_RETCODE SCIPconcurrentSolve(SCIP *scip)
    Definition: concurrent.c:508
    SCIP_Real SCIPgetConcurrentPrimalbound(SCIP *scip)
    Definition: concurrent.c:333
    SCIP_RETCODE SCIPcreateConcurrent(SCIP *scip, SCIP_CONCSOLVER *concsolver, int *varperm, int nvars)
    Definition: concurrent.c:67
    SCIP_RETCODE SCIPsynchronize(SCIP *scip)
    Definition: concurrent.c:258
    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:300
    SCIP_BOUNDSTORE * SCIPgetConcurrentGlobalBoundChanges(SCIP *scip)
    Definition: concurrent.c:472
    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:459
    SCIP_Longint SCIPgetConcurrentNTightenedBnds(SCIP *scip)
    Definition: concurrent.c:362
    void SCIPenableConcurrentBoundStorage(SCIP *scip)
    Definition: concurrent.c:288
    int SCIPgetNConcurrentSolvers(SCIP *scip)
    Definition: concurrent.c:126
    SCIP_RETCODE SCIPcopyConcurrentSolvingStats(SCIP *source, SCIP *target)
    Definition: concurrent.c:577
    SCIP_RETCODE SCIPaddConcurrentSol(SCIP *scip, SCIP_SOL *sol)
    Definition: concurrent.c:383
    SCIP_Real SCIPgetConcurrentGap(SCIP *scip)
    Definition: concurrent.c:348
    void SCIPdisableConcurrentBoundStorage(SCIP *scip)
    Definition: concurrent.c:276
    SCIP_Longint SCIPgetConcurrentNTightenedIntBnds(SCIP *scip)
    Definition: concurrent.c:373
    common defines and data types used in all packages of SCIP
    #define SCIP_Longint
    Definition: def.h:148
    #define SCIP_Bool
    Definition: def.h:98
    #define SCIP_Real
    Definition: def.h:163
    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