diff --git a/test_suite.sh b/test_suite.sh index 6e73fbd87c..464670b653 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -74,8 +74,10 @@ fi TMPDIR=$(mktemp -d) echo ">> Setting up environment..." -module --force purge -export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) +# For this call to be succesful, it needs to be able to import archspec (which is part of EESSI) +# Thus, we execute it in a subshell where EESSI is already initialized (a bit like a bootstrap) +export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(source $TOPDIR/init/bash > /dev/null 2>&1; python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) +echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" source $TOPDIR/init/bash @@ -136,40 +138,66 @@ echo "Configured reframe with the following environment variables:" env | grep "RFM_" # Inject correct CPU/memory properties into the ReFrame config file +echo "Collecting system-specific input for the ReFrame configuration file" cpuinfo=$(lscpu) if [[ "${cpuinfo}" =~ CPU\(s\):[^0-9]*([0-9]+) ]]; then cpu_count=${BASH_REMATCH[1]} + echo "Detected CPU count: ${cpu_count}" else fatal_error "Failed to get the number of CPUs for the current test hardware with lscpu." fi if [[ "${cpuinfo}" =~ Socket\(s\):[^0-9]*([0-9]+) ]]; then socket_count=${BASH_REMATCH[1]} + echo "Detected socket count: ${socket_count}" else fatal_error "Failed to get the number of sockets for the current test hardware with lscpu." fi if [[ "${cpuinfo}" =~ (Thread\(s\) per core:[^0-9]*([0-9]+)) ]]; then threads_per_core=${BASH_REMATCH[2]} + echo "Detected threads per core: ${threads_per_core}" else fatal_error "Failed to get the number of threads per core for the current test hardware with lscpu." fi if [[ "${cpuinfo}" =~ (Core\(s\) per socket:[^0-9]*([0-9]+)) ]]; then cores_per_socket=${BASH_REMATCH[2]} + echo "Detected cores per socket: ${cores_per_socket}" else fatal_error "Failed to get the number of cores per socket for the current test hardware with lscpu." fi -cgroup_mem_bytes=$(cat /hostsys/fs/cgroup/memory/slurm/uid_${UID}/job_${SLURM_JOB_ID}/memory.limit_in_bytes) +cgroup_v1_mem_limit="/sys/fs/cgroup/memory/$(