OpenMS
Loading...
Searching...
No Matches
OpenMSBuildInfo Struct Reference

Build-configuration accessors: build type, OpenMP availability, and OpenMP thread count. More...

#include <OpenMS/SYSTEM/BuildInfo.h>

Static Public Member Functions

static bool isOpenMPEnabled ()
 Return true when the library was compiled with OpenMP support (_OPENMP defined), false otherwise.
 
static std::string getBuildType ()
 Return the CMake build type baked into the library (e.g. "Release", "Debug"), captured from the OPENMS_BUILD_TYPE configure-time macro.
 
static Size getOpenMPMaxNumThreads ()
 Return the maximum number of OpenMP threads (including hyperthreads).
 
static void setOpenMPNumThreads (Int num_threads)
 Override the OpenMP thread count for subsequent parallel regions.
 

Detailed Description

Build-configuration accessors: build type, OpenMP availability, and OpenMP thread count.

Static utility methods only; the struct carries no state. All values reflect how the OpenMS library was compiled, not the running platform — see OpenMSOSInfo for the runtime view.

Member Function Documentation

◆ getBuildType()

static std::string getBuildType ( )
inlinestatic

Return the CMake build type baked into the library (e.g. "Release", "Debug"), captured from the OPENMS_BUILD_TYPE configure-time macro.

◆ getOpenMPMaxNumThreads()

static Size getOpenMPMaxNumThreads ( )
inlinestatic

Return the maximum number of OpenMP threads (including hyperthreads).

Wraps omp_get_max_threads(). Returns 1 if the library was compiled without OpenMP. The value can be capped by the OMP_NUM_THREADS environment variable and/or by setOpenMPNumThreads.

◆ isOpenMPEnabled()

static bool isOpenMPEnabled ( )
inlinestatic

Return true when the library was compiled with OpenMP support (_OPENMP defined), false otherwise.

◆ setOpenMPNumThreads()

static void setOpenMPNumThreads ( Int  num_threads)
inlinestatic

Override the OpenMP thread count for subsequent parallel regions.

Wraps omp_set_num_threads. No-op when the library was compiled without OpenMP. Takes precedence over the initial OMP_NUM_THREADS environment variable.