diff --git a/Control/AthenaCommon/share/ThinCAWrapper.sh b/Control/AthenaCommon/share/ThinCAWrapper.sh new file mode 100755 index 0000000000000000000000000000000000000000..10d4ee14c69582548abf152c2f50fd366d71bea3 --- /dev/null +++ b/Control/AthenaCommon/share/ThinCAWrapper.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# Demonstator for a thin wrapper to execute configurations with the CA +# + +topScriptSearchPath="." + +if [ ! -z "${WorkDir_DIR}" ] + then + topScriptSearchPath="$topScriptSearchPath $WorkDir_DIR_DIR/python" +fi + +if [ ! -z "${Athena_DIR}" ] + then + topScriptSearchPath="$topScriptSearchPath $Athena_DIR/python" +fi + +topscriptfile=`echo $otherargs | cut -d " " -f 1` +scriptargs=`echo $otherargs | cut -d " " -f 2-` + + +for pp in $topScriptSearchPath +do + if [ -f "$pp/$topscriptfile" ] + then + topscript="$pp/$topscriptfile" + break + fi +done + + +if [[ -z $topscript ]]; + then + echo "Could not find python script $topscriptfile" + exit 1 +fi + +python $topscript $scriptargs + + + diff --git a/Control/AthenaCommon/share/athena.py b/Control/AthenaCommon/share/athena.py index 1cc99b8102a5f5f78df4a64fff8b78c52062fb44..4efe84d8b7477633b8a8cbbc6a01c9fed6192dcb 100755 --- a/Control/AthenaCommon/share/athena.py +++ b/Control/AthenaCommon/share/athena.py @@ -9,7 +9,8 @@ # defaults export USETCMALLOC=0 export USEIMF=0 - +USECA=0 +otherargs="" # but use tcmalloc by default if TCMALLOCDIR is defined if [ -n "$TCMALLOCDIR" ]; then export USETCMALLOC=1 @@ -27,12 +28,20 @@ do --imf) USEIMF=1;; --preloadlib*) export ATHENA_ADD_PRELOAD=${a#*=};; --drop-and-reload) export ATHENA_DROP_RELOAD=1;; + --CA) USECA=1;; + *) otherargs="$otherargs $a";; esac done # Do the actual preloading via LD_PRELOAD source `which athena_preload.sh ` +if [ $USECA -eq 1 ] +then + source `which ThinCAWrapper.sh` + exit 0 +fi + # Now resurrect ourselves as python script python_path=`which python` "exec" "$python_path" "-tt" "$0" "$@";