diff --git a/Control/AthenaCommon/python/AthOptionsParser.py b/Control/AthenaCommon/python/AthOptionsParser.py index b4c0129447c4ea25b57ccda5efc3119b01dfddf5..59f93c35aa6577823f97e729cd4f43b662b10740 100644 --- a/Control/AthenaCommon/python/AthOptionsParser.py +++ b/Control/AthenaCommon/python/AthOptionsParser.py @@ -29,7 +29,7 @@ _userlongopts = [ "enable-ers-hdlr=", "keep-configuration","drop-configuration", "drop-and-reload", "config-only=", "dump-configuration=", - "tcmalloc", "stdcmalloc", "preloadlib=", + "tcmalloc", "stdcmalloc", "stdcmath", "imf", "preloadlib=", "nprocs=", "debugWorker", "pycintex_minvmem=", "cppyy_minvmem", @@ -93,6 +93,8 @@ Accepted command line options: --dump-configuration=<file> ... dump an ASCII version of the post-setup() configuration to <file> --tcmalloc ... use tcmalloc.so for memory allocation [DEFAULT]. This disables leak-check --stdcmalloc ... use libc malloc for memory allocation + --stdcmath ... use glibc math functions [DEFAULT] + --imf ... use Intel Math Function library: may give different numerical results from --stdcmath --preloadlib=<lib> ... localized preload of library <lib> --nprocs=n ... enable AthenaMP if n>=1 or n==-1 --threads=n ... number of threads for AthenaMT diff --git a/Control/AthenaCommon/share/athena.py b/Control/AthenaCommon/share/athena.py index 068658ad566f725dc1ac404e06939431f585d811..02d1d3402083ee1808735e3b126c2d3d43e9eb2a 100755 --- a/Control/AthenaCommon/share/athena.py +++ b/Control/AthenaCommon/share/athena.py @@ -32,6 +32,11 @@ fi export ATHENA_ADD_PRELOAD ATHENA_DROP_RELOAD=0 +export USEIMF=false +export IMF_LIB1="libimf.so" +export IMF_LIB2="libintlc.so.5" + + for a in ${@} do case "$a" in @@ -39,6 +44,8 @@ do --delete-check*) USETCMALLOC=0;; --stdcmalloc) USETCMALLOC=0;; --tcmalloc) USETCMALLOC=1;; + --stdcmath) USEIMF=0;; + --imf) USEIMF=1;; --preloadlib*) ATHENA_ADD_PRELOAD=${a#*=};; --drop-and-reload) ATHENA_DROP_RELOAD=1;; esac @@ -80,6 +87,26 @@ if [ "$USETCMALLOC" = "1" ] || [ "$USETCMALLOC" = "true" ] ; then fi fi +if [ $USEIMF == "1" ] || [ $USEIMF == true ]; then +fullimf1="$ATLASMKLLIBDIR_PRELOAD/$IMF_LIB1" +fullimf2="$ATLASMKLLIBDIR_PRELOAD/$IMF_LIB2" + if [ ! -e "$fullimf1" ]; then + echo "ERROR: $fullimf1 does not exit" + exit 1 + elif [ ! -e "$fullimf2" ]; then + echo "ERROR: $fullimf2 does not exit" + exit 1 + else + echo "Preloading $IMF_LIB1" + echo "Preloading $IMF_LIB2" + if [ -z $LD_PRELOAD ]; then + export LD_PRELOAD="$fullimf1:$fullimf2" + else + export LD_PRELOAD="$fullimf1:$fullimf2:$LD_PRELOAD" + fi + fi +fi + # optionally add user-specific preload library if [ "x$ATHENA_ADD_PRELOAD" != "x" ] && [ $ATHENA_DROP_RELOAD -eq 0 ]; then echo "Preloading $ATHENA_ADD_PRELOAD"