Scippy

GCG

Branch-and-Price & Column Generation for Everyone

type_locks.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* GCG --- Generic Column Generation */
5/* a Dantzig-Wolfe decomposition based extension */
6/* of the branch-cut-and-price framework */
7/* SCIP --- Solving Constraint Integer Programs */
8/* */
9/* Copyright (C) 2010-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file type_locks.h
30 * @ingroup TYPEDEFINITIONS
31 * @brief type definitions for locks data structure
32 * @author Erik Muehmer
33 */
34
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36
37#ifndef GCG_TYPE_GCGLOCKS_H__
38#define GCG_TYPE_GCGLOCKS_H__
39
40#ifdef _OPENMP
41#include <omp.h>
42#endif
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48#ifdef _OPENMP
49
50#define GCG_LOCK omp_nest_lock_t
51
52typedef struct GCG_Locks GCG_LOCKS; /**< data structure to store OpenMP locks */
53
54#define GCG_SET_LOCK(lockptr) omp_set_nest_lock(lockptr)
55
56#define GCG_UNSET_LOCK(lockptr) omp_unset_nest_lock(lockptr)
57
58#define GCG_INIT_LOCK(lockptr) omp_init_nest_lock(lockptr)
59
60#define GCG_DESTROY_LOCK(lockptr) omp_destroy_nest_lock(lockptr)
61
62#else
63
64#define GCG_LOCK void
65
66typedef void GCG_LOCKS;
67
68#define GCG_SET_LOCK(lockname) 0
69
70#define GCG_UNSET_LOCK(lockname) 0
71
72#define GCG_INIT_LOCK(lockptr) 0
73
74#define GCG_DESTROY_LOCK(lockptr) 0
75
76#endif
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
void GCG_LOCKS
Definition: type_locks.h:66