Skip to content
Snippets Groups Projects
Commit a25cc3e0 authored by Michael Langguth's avatar Michael Langguth
Browse files

Changes to create_env.sh: Only check modules when creating new virtual...

Changes to create_env.sh: Only check modules when creating new virtual environment, load postprocessing modules and stick to them when building/actiating virtual env.
parent bed6d433
No related branches found
No related tags found
No related merge requests found
Pipeline #68045 passed
......@@ -63,7 +63,9 @@ else
ENV_EXIST=0
fi
# add personal email-address to Batch-scripts
# Create fresh virtual environment or just activate the existing one
if [[ "$ENV_EXIST" == 0 ]]; then
# Check modules first
if [[ "${HOST_NAME}" == hdfml* || "${HOST_NAME}" == *juwels* ]]; then
if [[ "${HOST_NAME}" == jwlogin2[1-4]* ]]; then
# on Juwels Booster, we are in a container environment -> loading modules is not possible
......@@ -82,8 +84,6 @@ else
# unset PYTHONPATH on every other machine that is not a known HPC-system
unset PYTHONPATH
fi
if [[ "$ENV_EXIST" == 0 ]]; then
# Activate virtual environment and install additional Python packages.
echo "Configuring and activating virtual environment on ${HOST_NAME}"
......@@ -143,7 +143,8 @@ if [[ "$ENV_EXIST" == 0 ]]; then
fi
info_str="Virtual environment ${ENV_DIR} has been set up successfully."
elif [[ "$ENV_EXIST" == 1 ]]; then
# activating virtual env is suifficient
# loading modules of postprocessing and activating virtual env are suifficient
source ${ENV_SETUP_DIR}/modules_postprocess.sh
source ${ENV_DIR}/bin/activate
info_str="Virtual environment ${ENV_DIR} has been activated successfully."
fi
......@@ -158,6 +159,6 @@ echo "Make use of config_runscript.py to generate customized runscripts of the w
echo "******************************************** NOTE ********************************************"
# finally clean up loaded modules (if we are not on Juwels)
if [[ "${HOST_NAME}" == *hdfml* || "${HOST_NAME}" == *juwels* ]] && [[ "${HOST_NAME}" != jwlogin2[1-4]* ]]; then
module --force purge
fi
#if [[ "${HOST_NAME}" == *hdfml* || "${HOST_NAME}" == *juwels* ]] && [[ "${HOST_NAME}" != jwlogin2[1-4]* ]]; then
# module --force purge
#fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment