@@ -146,6 +146,14 @@ NWORKERS=${NWORKERS:-8}
146146SEED=${ALIEN_PROC_ID:- ${SEED:- 1} }
147147
148148ONCVMFS=0
149+
150+ if ! declare -F module > /dev/null; then
151+ module () {
152+ eval " $( /usr/bin/modulecmd bash " $@ " ) " ;
153+ }
154+ export -f module
155+ fi
156+
149157[[ " ${BASEDIR} " == /cvmfs/* ]] && ONCVMFS=1
150158if [ ! " ${MODULEPATH} " ]; then
151159 export MODULEPATH=${BASEDIR} /../Modules/modulefiles
159167# <----- START OF part that should run under a clean alternative software environment if this was given ------
160168if [ " ${ALIEN_JDL_O2DPG_ASYNC_RECO_TAG} " ]; then
161169 if [ " ${LOADEDMODULES} " ]; then
170+ echo " Stashing initial modules"
162171 module save initial_modules.list # we stash the current modules environment
163- module purge
172+ module list --no-pager
173+ module purge --no-pager
174+ export > env_after_stashing.env
175+ echo " Modules after purge"
176+ module list --no-pager
164177 fi
165178 echo_info " Using tag ${ALIEN_JDL_O2DPG_ASYNC_RECO_TAG} to setup anchored MC"
166179 /cvmfs/alice.cern.ch/bin/alienv printenv " ${ALIEN_JDL_O2DPG_ASYNC_RECO_TAG} " & > async_environment.env
167180 source async_environment.env
181+ export > env_async.env
168182fi
169183
170184# default async_pass.sh script
230244
231245# get rid of the temporary software environment
232246if [ " ${ALIEN_JDL_O2DPG_ASYNC_RECO_TAG} " ]; then
233- module purge
247+ module purge --no-pager
234248 # restore the initial software environment
235249 echo " Restoring initial environment"
236250 module --no-pager restore initial_modules.list
0 commit comments