Skip to content
Snippets Groups Projects
Commit b27b1160 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau Committed by Florian Uhlig
Browse files

Add OpenMP thread Nb var to config script + opt. override, Refs #2622

parent 07b3661d
Branches
Tags
1 merge request!998Add OpenMP thread Nb var to config script + opt. override, Refs #2622
Pipeline #19630 passed
......@@ -197,7 +197,12 @@ set(FAIRROOT_LIBRARY_PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES}
SOVERSION "${CBMROOT_MAJOR_VERSION}"
)
# Searching for OpenMP + control variable prep. for config script (default behavior + override)
find_package(OpenMP)
set(OMP_NUM_THREADS 1)
If(DEFINED ENV{OMP_NUM_THREADS} )
set(OMP_NUM_THREADS $ENV{OMP_NUM_THREADS})
endif()
# set a variable which should be used in all CMakeLists.txt
# Defines all basic include directories from fairbase
......
......@@ -30,6 +30,14 @@ if ( "$same_system" == "1" ) then
setenv VMCWORKDIR "@VMCWORKDIR@"
setenv FAIRLIBDIR "@FAIRLIBDIR@"
setenv PYTHONPATH "@MY_PYTHONPATH@"
setenv OMP_NUM_THREADS @OMP_NUM_THREADS@
if (! $?OMP_NUM_THREADS) then
setenv OMP_NUM_THREADS @OMP_NUM_THREADS@
else
if ("$OMP_NUM_THREADS" == "") then
setenv OMP_NUM_THREADS @OMP_NUM_THREADS@
endif
endif
switch( $1 )
case '-a' :
setenv DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH:"@MY_DYLD_LIBRARY_PATH@"
......
......@@ -29,6 +29,10 @@ if [ $same_system -eq 1 ]; then
export VMCWORKDIR="@VMCWORKDIR@"
export FAIRLIBDIR="@FAIRLIBDIR@"
export PYTHONPATH="@MY_PYTHONPATH@"
if [[ -z "${OMP_NUM_THREADS}" ]]; then
export OMP_NUM_THREADS=@OMP_NUM_THREADS@
fi
case $1 in
-a | --append )
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:"@MY_DYLD_LIBRARY_PATH@"
......
......@@ -2,7 +2,7 @@
# This macro is needed to start the Root macros used for automatic testing
# from inside CMake using the add_test functionality. Since the tests
# starts with a fresh environment on has to set first the correct environment
# starts with a fresh environment one has to set first the correct environment
# needed to run FairRoot.
# Also parameters defined in add_test will be converted in the correct format
# to be passed to root.
......@@ -19,6 +19,9 @@ export VMCWORKDIR=@VMCWORKDIR@
export Geant4VMC_MACRO_DIR=@Geant4VMC_MACRO_DIR@
export USE_VGM=1
export BOOST=@Boost_Avail@
if [[ -z "${OMP_NUM_THREADS}" ]]; then
export OMP_NUM_THREADS=@OMP_NUM_THREADS@
fi
@Geant4Data_Variables_sh@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment