From 887bc8a84f1ea07bec56cca5b675309938d049e5 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 11 Oct 2024 17:43:35 +0200 Subject: [PATCH 01/34] Add accelerator detection to Lmod version of EESSI initialisation --- init/lmod_eessi_archdetect_wrapper_accel.sh | 2 ++ init/modules/EESSI/2023.06.lua | 35 +++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 init/lmod_eessi_archdetect_wrapper_accel.sh diff --git a/init/lmod_eessi_archdetect_wrapper_accel.sh b/init/lmod_eessi_archdetect_wrapper_accel.sh new file mode 100644 index 0000000000..d4a0038cb5 --- /dev/null +++ b/init/lmod_eessi_archdetect_wrapper_accel.sh @@ -0,0 +1,2 @@ +# This can be leveraged by the source_sh() feature of Lmod +export EESSI_ACCEL_SUBDIR=$($(dirname $(readlink -f $BASH_SOURCE))/eessi_archdetect.sh accelpath) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 463706ce6c..d3ecf58813 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -42,14 +42,27 @@ function archdetect_cpu() end LmodError("Software directory check for the detected architecture failed") end +function archdetect_accel() + local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper_accel.sh') + if not os.getenv("EESSI_ACCEL_SUBDIR") then + if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then + LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ACCEL_SUBDIR to the available accelerator architecture in the form of: accel/nvidia/cc80") + end + source_sh("bash", script) + end + local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or "" + return archdetect_accel +end local archdetect = archdetect_cpu() +local archdetect_accel = archdetect_accel() local eessi_cpu_family = archdetect:match("([^/]+)") local eessi_software_subdir = archdetect local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family) local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) -local eessi_module_path = pathJoin(eessi_software_path, "modules", "all") +local eessi_modules_subdir = pathJoin("modules", "all") +local eessi_module_path = pathJoin(eessi_software_path, eessi_modules_subdir) local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") -local eessi_site_module_path = pathJoin(eessi_site_software_path, "modules", "all") +local eessi_site_module_path = pathJoin(eessi_site_software_path, eessi_modules_subdir) setenv("EPREFIX", eessi_eprefix) setenv("EESSI_CPU_FAMILY", eessi_cpu_family) setenv("EESSI_SITE_SOFTWARE_PATH", eessi_site_software_path) @@ -65,8 +78,24 @@ if ( mode() ~= "spider" ) then prepend_path("MODULEPATH", eessi_module_path) end prepend_path("LMOD_RC", pathJoin(eessi_software_path, "/.lmod/lmodrc.lua")) -prepend_path("MODULEPATH", eessi_site_module_path) setenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod")) + +-- the accelerator may have an empty value and we need to give some flexibility +-- * construct the path we expect to find +-- * then check it exists +-- * then update the modulepath +if not (archdetect_accel == nil or archdetect_accel == '') then + eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir + eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) + eessi_module_path_accel = pathJoin(eessi_accel_software_path, eessi_accel_software_subdir, eessi_modules_subdir) + if isDir(eessi_modulepath_accel) then + setenv("EESSI_MODULEPATH_ACCEL", eessi_module_path_accel) + prepend_path("MODULEPATH", eessi_module_path_accel) + end +end + +-- prepend the site module path last so it has priority +prepend_path("MODULEPATH", eessi_site_module_path) if mode() == "load" then LmodMessage("EESSI/" .. eessi_version .. " loaded successfully") end From 2c7553bb4a34f5c09e5b9bc4e83d8d0801bdc2a9 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 11 Oct 2024 18:37:10 +0200 Subject: [PATCH 02/34] Make a separate PR for the lmod wrapper --- init/lmod_eessi_archdetect_wrapper_accel.sh | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 init/lmod_eessi_archdetect_wrapper_accel.sh diff --git a/init/lmod_eessi_archdetect_wrapper_accel.sh b/init/lmod_eessi_archdetect_wrapper_accel.sh deleted file mode 100644 index d4a0038cb5..0000000000 --- a/init/lmod_eessi_archdetect_wrapper_accel.sh +++ /dev/null @@ -1,2 +0,0 @@ -# This can be leveraged by the source_sh() feature of Lmod -export EESSI_ACCEL_SUBDIR=$($(dirname $(readlink -f $BASH_SOURCE))/eessi_archdetect.sh accelpath) From cf5491b1f1cdc946af90c9b130b675ccec16c3f5 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 13:58:37 +0200 Subject: [PATCH 03/34] Add accelerator check to Lmod init script --- .github/workflows/tests_eessi_module.yml | 35 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index cbcffe6385..3c29c6ee56 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -7,13 +7,13 @@ on: permissions: contents: read # to fetch code (actions/checkout) jobs: - build: + basic_checks: runs-on: ubuntu-latest strategy: fail-fast: false matrix: EESSI_VERSION: - - 2023.06 + - 2023.06 steps: - name: Check out software-layer repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -60,10 +60,40 @@ jobs: fi unset EESSI_ARCHDETECT_OPTIONS set -e # Re-enable exit on non-zero status + + lmod_and_init_script_comparison: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + EESSI_VERSION: + - 2023.06 + EESSI_SOFTWARE_SUBDIR_OVERRIDE: + - x86_64/amd/zen2 + EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE: + - none + - accel/nvidia/cc80 + steps: + - name: Check out software-layer repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Mount EESSI CernVM-FS pilot repository + uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0 + with: + cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb + cvmfs_http_proxy: DIRECT + cvmfs_repositories: software.eessi.io - name: Test for expected variables while adding dummy cpu archs and loading EESSI module run: | . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + + # Set our path overrides according to our matrix + export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} + if [[ "${{matrix.EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE}}" != "none" ]]; then + export EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE}} + fi + export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) export EESSI_ARCHDETECT_OPTIONS="dummy/cpu:${CPU_ARCH}:dummy1/cpu1" @@ -83,4 +113,3 @@ jobs: diff "${moduleoutfile}" "${sourceoutfile}" exit 1 fi - From e7eb8798181e71bde87077339893c45891c5f59c Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 14:25:50 +0200 Subject: [PATCH 04/34] Match all variables that start with EESSI_ --- .github/workflows/tests_eessi_module.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 3c29c6ee56..c874b50403 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -100,10 +100,11 @@ jobs: moduleoutfile="moduleout.txt" sourceoutfile="sourceout.txt" module load EESSI/${{matrix.EESSI_VERSION}} - env | grep -E '^(EESSI_S|EESSI_C)' | sort > "${moduleoutfile}" + unset EESSI_ARCHDETECT_OPTIONS + env | grep -E '^EESSI_' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} source ./init/bash - env | grep -E '^(EESSI_S|EESSI_C)' | sort > "${sourceoutfile}" + env | grep -E '^EESSI_' | sort > "${sourceoutfile}" cat "${moduleoutfile}" cat "${sourceoutfile}" if (diff "${moduleoutfile}" "${sourceoutfile}" > /dev/null); then From 1311055a365937a03b5577c6fda8ba19af1c2580 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 14:32:39 +0200 Subject: [PATCH 05/34] Lmod init uses archdetect, but init script still uses archspec --- .github/workflows/tests_eessi_module.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index c874b50403..f581bda3b7 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -69,7 +69,7 @@ jobs: EESSI_VERSION: - 2023.06 EESSI_SOFTWARE_SUBDIR_OVERRIDE: - - x86_64/amd/zen2 + - x86_64/amd/zen3 EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE: - none - accel/nvidia/cc80 @@ -101,9 +101,13 @@ jobs: sourceoutfile="sourceout.txt" module load EESSI/${{matrix.EESSI_VERSION}} unset EESSI_ARCHDETECT_OPTIONS + # module version uses archdetect (ignore this) + unset EESSI_USE_ARCHDETECT env | grep -E '^EESSI_' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} source ./init/bash + # source script version uses archspec (ignore this) + unset EESSI_USE_ARCHSPEC env | grep -E '^EESSI_' | sort > "${sourceoutfile}" cat "${moduleoutfile}" cat "${sourceoutfile}" From d4d5a796a7e2d5a3fe9fbaed7ca6a9fbc8d15bad Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 14:43:50 +0200 Subject: [PATCH 06/34] init script is the only one who sets EESSI_ARCHDETECT EESSI_ARCHSPEC --- .github/workflows/tests_eessi_module.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index f581bda3b7..693e293a04 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -101,13 +101,12 @@ jobs: sourceoutfile="sourceout.txt" module load EESSI/${{matrix.EESSI_VERSION}} unset EESSI_ARCHDETECT_OPTIONS - # module version uses archdetect (ignore this) - unset EESSI_USE_ARCHDETECT env | grep -E '^EESSI_' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} source ./init/bash - # source script version uses archspec (ignore this) + # source script version sets environment variables to force archdetect, ignore these unset EESSI_USE_ARCHSPEC + unset EESSI_USE_ARCHDETECT env | grep -E '^EESSI_' | sort > "${sourceoutfile}" cat "${moduleoutfile}" cat "${sourceoutfile}" From c7d423017d61e1cf1186358515ae0e9db49725c1 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 14:55:06 +0200 Subject: [PATCH 07/34] Use the correct override for when GPUs are expected --- .github/workflows/tests_eessi_module.yml | 28 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 693e293a04..dfb4a28842 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -70,7 +70,7 @@ jobs: - 2023.06 EESSI_SOFTWARE_SUBDIR_OVERRIDE: - x86_64/amd/zen3 - EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE: + EESSI_ACCELERATOR_TARGET_OVERRIDE: - none - accel/nvidia/cc80 steps: @@ -90,30 +90,44 @@ jobs: # Set our path overrides according to our matrix export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} - if [[ "${{matrix.EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE}}" != "none" ]]; then - export EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE}} + if [[ "${{matrix.EESSI_ACCELERATOR_TARGET_OVERRIDE}}" != "none" ]]; then + export EESSI_ACCELERATOR_TARGET_OVERRIDE=${{matrix.EESSI_ACCELERATOR_TARGET_OVERRIDE}} fi - + + moduleoutfile="moduleout.txt" + sourceoutfile="sourceout.txt" + + # First do (and undo) the Lmod initialisation export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) export EESSI_ARCHDETECT_OPTIONS="dummy/cpu:${CPU_ARCH}:dummy1/cpu1" - moduleoutfile="moduleout.txt" - sourceoutfile="sourceout.txt" module load EESSI/${{matrix.EESSI_VERSION}} + # EESSI_ARCHDETECT_OPTIONS only relevant for Lmod init unset EESSI_ARCHDETECT_OPTIONS + # Store all relevant environment variables env | grep -E '^EESSI_' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} + + # Now do the init script initialisation source ./init/bash # source script version sets environment variables to force archdetect, ignore these unset EESSI_USE_ARCHSPEC unset EESSI_USE_ARCHDETECT env | grep -E '^EESSI_' | sort > "${sourceoutfile}" + + # Now compare the two results + echo "" + echo "Lmod initialisation:" cat "${moduleoutfile}" + echo "" + echo "Source script initialisation:" cat "${sourceoutfile}" + echo "" + echo "" if (diff "${moduleoutfile}" "${sourceoutfile}" > /dev/null); then echo "Test for checking env variables PASSED" else echo "Test for checking env variables FAILED" >&2 - diff "${moduleoutfile}" "${sourceoutfile}" + diff --unified=0 "${moduleoutfile}" "${sourceoutfile}" exit 1 fi From 5fd01f8a2da5987075d364b947d150e47b83e9b5 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 16:12:30 +0200 Subject: [PATCH 08/34] Add a load/unload test to make sure we return the environment to it's original state --- .github/workflows/tests_eessi_module.yml | 64 ++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index dfb4a28842..b629ae531f 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -71,7 +71,6 @@ jobs: EESSI_SOFTWARE_SUBDIR_OVERRIDE: - x86_64/amd/zen3 EESSI_ACCELERATOR_TARGET_OVERRIDE: - - none - accel/nvidia/cc80 steps: - name: Check out software-layer repository @@ -90,9 +89,7 @@ jobs: # Set our path overrides according to our matrix export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} - if [[ "${{matrix.EESSI_ACCELERATOR_TARGET_OVERRIDE}}" != "none" ]]; then - export EESSI_ACCELERATOR_TARGET_OVERRIDE=${{matrix.EESSI_ACCELERATOR_TARGET_OVERRIDE}} - fi + export EESSI_ACCELERATOR_TARGET_OVERRIDE=${{matrix.EESSI_ACCELERATOR_TARGET_OVERRIDE}} moduleoutfile="moduleout.txt" sourceoutfile="sourceout.txt" @@ -131,3 +128,62 @@ jobs: diff --unified=0 "${moduleoutfile}" "${sourceoutfile}" exit 1 fi + + make_sure_load_and_unload_work: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + EESSI_VERSION: + - 2023.06 + EESSI_SOFTWARE_SUBDIR_OVERRIDE: + - x86_64/amd/zen2 + - x86_64/amd/zen3 + steps: + - name: Check out software-layer repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Mount EESSI CernVM-FS pilot repository + uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0 + with: + cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb + cvmfs_http_proxy: DIRECT + cvmfs_repositories: software.eessi.io + + - name: Test for expected variables while adding dummy cpu archs and loading EESSI module + run: | + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + + # Set our path overrides according to our matrix + export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} + + initial_env_file="initial_env.txt" + module_cycled_file="load_unload_cycle.txt" + + # Store the initial environment + env | grep -E '^EESSI_' | sort > "${initial_env_file}" + + # Do (and undo) loading the EESSI module + export MODULEPATH=init/modules + CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) + export EESSI_ARCHDETECT_OPTIONS="dummy/cpu:${CPU_ARCH}:dummy1/cpu1" + module load EESSI/${{matrix.EESSI_VERSION}} + module unload EESSI/${{matrix.EESSI_VERSION}} + env | grep -E '^EESSI_' | sort > "${module_cycled_file}" + + # Now compare the two results + echo "" + echo "Initial environment:" + cat "${initial_env_file}" + echo "" + echo "Environment after load/unload cycle of EESSI:" + cat "${module_cycled_file}" + echo "" + echo "" + if (diff "${initial_env_file}" "${module_cycled_file}" > /dev/null); then + echo "Test for checking env variables PASSED" + else + echo "Test for checking env variables FAILED" >&2 + diff --unified=0 "${initial_env_file}" "${module_cycled_file}" + exit 1 + fi \ No newline at end of file From 7abcdc337b5416c3e3713d01aeeaf476eb512664 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 20:19:09 +0200 Subject: [PATCH 09/34] Try to make module work in load and unload modes --- .github/workflows/tests_eessi_module.yml | 1 - init/modules/EESSI/2023.06.lua | 46 +++++++++++++++--------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index b629ae531f..50578d7904 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -166,7 +166,6 @@ jobs: # Do (and undo) loading the EESSI module export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) - export EESSI_ARCHDETECT_OPTIONS="dummy/cpu:${CPU_ARCH}:dummy1/cpu1" module load EESSI/${{matrix.EESSI_VERSION}} module unload EESSI/${{matrix.EESSI_VERSION}} env | grep -E '^EESSI_' | sort > "${module_cycled_file}" diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index d3ecf58813..57eb3e41d1 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -17,40 +17,54 @@ local eessi_os_type = "linux" setenv("EESSI_VERSION", eessi_version) setenv("EESSI_CVMFS_REPO", eessi_repo) setenv("EESSI_OS_TYPE", eessi_os_type) +function eessiDebug(text) + if os.getenv("EESSI_DEBUG_INIT") then + LmodMessage(text) + end +end function archdetect_cpu() local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper.sh') - if not os.getenv("EESSI_ARCHDETECT_OPTIONS") then + if not os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") then if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then - LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ARCHDETECT_OPTIONS to the available cpu architecture in the form of: x86_64/intel/haswell:x86_64/generic or aarch64/neoverse_v1:aarch64/generic") + LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ARCHDETECT_OPTIONS_OVERRIDE to the available cpu architecture in the form of: x86_64/intel/haswell:x86_64/generic or aarch64/neoverse_v1:aarch64/generic") end source_sh("bash", script) end - local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or "" - for archdetect_filter_cpu in string.gmatch(archdetect_options, "([^" .. ":" .. "]+)") do - if isDir(pathJoin(eessi_prefix, "software", eessi_os_type, archdetect_filter_cpu, "software")) then - -- use x86_64/amd/zen3 for now when AMD Genoa (Zen4) CPU is detected, - -- since optimized software installations for Zen4 are a work-in-progress, - -- see https://gitlab.com/eessi/support/-/issues/37 - if archdetect_filter_cpu == "x86_64/amd/zen4" then - archdetect_filter_cpu = "x86_64/amd/zen3" - if mode() == "load" then - LmodMessage("Sticking to " .. archdetect_filter_cpu .. " for now, since optimized installations for AMD Genoa (Zen4) are a work in progress.") + -- EESSI_ARCHDETECT_OPTIONS is set by the script (_if_ it was called) + local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or (os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") or "") + if archdetect_options then + eessiDebug("Got archdetect CPU options: " .. archdetect_options) + for archdetect_filter_cpu in string.gmatch(archdetect_options, "([^" .. ":" .. "]+)") do + if isDir(pathJoin(eessi_prefix, "software", eessi_os_type, archdetect_filter_cpu, "software")) then + -- use x86_64/amd/zen3 for now when AMD Genoa (Zen4) CPU is detected, + -- since optimized software installations for Zen4 are a work-in-progress, + -- see https://gitlab.com/eessi/support/-/issues/37 + if archdetect_filter_cpu == "x86_64/amd/zen4" then + archdetect_filter_cpu = "x86_64/amd/zen3" + if mode() == "load" then + LmodMessage("Sticking to " .. archdetect_filter_cpu .. " for now, since optimized installations for AMD Genoa (Zen4) are a work in progress.") + end end + eessiDebug("Selected archdetect CPU: " .. archdetect_filter_cpu) + return archdetect_filter_cpu end - return archdetect_filter_cpu end + LmodError("Software directory check for the detected architecture failed") + else + -- Still need to return something + return nil end - LmodError("Software directory check for the detected architecture failed") end function archdetect_accel() local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper_accel.sh') - if not os.getenv("EESSI_ACCEL_SUBDIR") then + if not os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE ") then if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then - LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ACCEL_SUBDIR to the available accelerator architecture in the form of: accel/nvidia/cc80") + LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ACCELERATOR_TARGET_OVERRIDE to the available accelerator architecture in the form of: accel/nvidia/cc80") end source_sh("bash", script) end local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or "" + eessiDebug("Got archdetect accel option: " .. archdetect_accel) return archdetect_accel end local archdetect = archdetect_cpu() From e4ac2fa59769f77fdbfc7b9a3de403e47c095b6c Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 20:44:50 +0200 Subject: [PATCH 10/34] Fix lots of small issues --- init/modules/EESSI/2023.06.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 57eb3e41d1..9ac6d5e6de 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -24,6 +24,8 @@ function eessiDebug(text) end function archdetect_cpu() local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper.sh') + -- make sure that we grab the value for architecture before the module unsets the environment variable (in unload mode) + local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or (os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") or "") if not os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") then if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ARCHDETECT_OPTIONS_OVERRIDE to the available cpu architecture in the form of: x86_64/intel/haswell:x86_64/generic or aarch64/neoverse_v1:aarch64/generic") @@ -31,7 +33,7 @@ function archdetect_cpu() source_sh("bash", script) end -- EESSI_ARCHDETECT_OPTIONS is set by the script (_if_ it was called) - local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or (os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") or "") + archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or archdetect_options if archdetect_options then eessiDebug("Got archdetect CPU options: " .. archdetect_options) for archdetect_filter_cpu in string.gmatch(archdetect_options, "([^" .. ":" .. "]+)") do @@ -57,13 +59,15 @@ function archdetect_cpu() end function archdetect_accel() local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper_accel.sh') + -- for unload mode, we need to grab the value before it is unset + local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or (os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE") or "") if not os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE ") then if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ACCELERATOR_TARGET_OVERRIDE to the available accelerator architecture in the form of: accel/nvidia/cc80") end source_sh("bash", script) end - local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or "" + archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or archdetect_accel eessiDebug("Got archdetect accel option: " .. archdetect_accel) return archdetect_accel end @@ -101,8 +105,8 @@ setenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod")) if not (archdetect_accel == nil or archdetect_accel == '') then eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) - eessi_module_path_accel = pathJoin(eessi_accel_software_path, eessi_accel_software_subdir, eessi_modules_subdir) - if isDir(eessi_modulepath_accel) then + eessi_module_path_accel = pathJoin(eessi_accel_software_path, archdetect_accel, eessi_modules_subdir) + if isDir(eessi_module_path_accel) then setenv("EESSI_MODULEPATH_ACCEL", eessi_module_path_accel) prepend_path("MODULEPATH", eessi_module_path_accel) end From 38297912b4ebb2355bfab94440d64ef54e494de1 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 21:33:23 +0200 Subject: [PATCH 11/34] Fix lots of small issues --- .github/workflows/tests_eessi_module.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 50578d7904..c4a56ba0aa 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -48,7 +48,7 @@ jobs: . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod export MODULEPATH=init/modules set +e # Do not exit immediately if a command exits with a non-zero status - export EESSI_ARCHDETECT_OPTIONS="dummy/cpu" + export EESSI_ARCHDETECT_OPTIONS_OVERRIDE="dummy/cpu" outfile="outfile.txt" module load EESSI/${{matrix.EESSI_VERSION}} > "${outfile}" 2>&1 cat "${outfile}" @@ -58,7 +58,7 @@ jobs: echo "Test for picking up invalid path on \${archdetect_cpu} FAILED" >&2 exit 1 fi - unset EESSI_ARCHDETECT_OPTIONS + unset EESSI_ARCHDETECT_OPTIONS_OVERRIDE set -e # Re-enable exit on non-zero status lmod_and_init_script_comparison: @@ -97,10 +97,10 @@ jobs: # First do (and undo) the Lmod initialisation export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) - export EESSI_ARCHDETECT_OPTIONS="dummy/cpu:${CPU_ARCH}:dummy1/cpu1" + export EESSI_ARCHDETECT_OPTIONS_OVERRIDE="dummy/cpu:${CPU_ARCH}:dummy1/cpu1" module load EESSI/${{matrix.EESSI_VERSION}} - # EESSI_ARCHDETECT_OPTIONS only relevant for Lmod init - unset EESSI_ARCHDETECT_OPTIONS + # EESSI_ARCHDETECT_OPTIONS_OVERRIDE only relevant for Lmod init + unset EESSI_ARCHDETECT_OPTIONS_OVERRIDE # Store all relevant environment variables env | grep -E '^EESSI_' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} From 443cdef1a8d88092c3d3cd90835d8a743ae0eb57 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 21:38:57 +0200 Subject: [PATCH 12/34] Fix lots of small issues --- .github/workflows/tests_eessi_module.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index c4a56ba0aa..6013003d26 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -83,7 +83,7 @@ jobs: cvmfs_http_proxy: DIRECT cvmfs_repositories: software.eessi.io - - name: Test for expected variables while adding dummy cpu archs and loading EESSI module + - name: Test for expected variables match between Lmod init script and original bash script run: | . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod @@ -137,6 +137,7 @@ jobs: EESSI_VERSION: - 2023.06 EESSI_SOFTWARE_SUBDIR_OVERRIDE: + - none - x86_64/amd/zen2 - x86_64/amd/zen3 steps: @@ -155,7 +156,9 @@ jobs: . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod # Set our path overrides according to our matrix - export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} + if [[ "${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}" != "none" ]]; then + export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} + fi initial_env_file="initial_env.txt" module_cycled_file="load_unload_cycle.txt" From 78293e6a282d4405c35a432b2ccece1c4716f300 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 21:47:23 +0200 Subject: [PATCH 13/34] Use debug feature for module a bit more --- init/modules/EESSI/2023.06.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 9ac6d5e6de..b88f5b25c8 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -109,6 +109,7 @@ if not (archdetect_accel == nil or archdetect_accel == '') then if isDir(eessi_module_path_accel) then setenv("EESSI_MODULEPATH_ACCEL", eessi_module_path_accel) prepend_path("MODULEPATH", eessi_module_path_accel) + eessiDebug("Using acclerator modules at: " .. eessi_module_path_accel) end end From fa10c1a876b00600ccfb9fd13932f57ba9615b8d Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 15 Oct 2024 21:56:22 +0200 Subject: [PATCH 14/34] Correct comment in action --- .github/workflows/tests_eessi_module.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 6013003d26..0fb5c656f0 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -151,7 +151,7 @@ jobs: cvmfs_http_proxy: DIRECT cvmfs_repositories: software.eessi.io - - name: Test for expected variables while adding dummy cpu archs and loading EESSI module + - name: Test for identical environment after loading and unloading the EESSI module run: | . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod From 9c4897ce56fae9952da7c4533e86a896bb2c869f Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 09:55:12 +0200 Subject: [PATCH 15/34] Add more debug logging --- init/modules/EESSI/2023.06.lua | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index b88f5b25c8..55a77335fc 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -18,7 +18,7 @@ setenv("EESSI_VERSION", eessi_version) setenv("EESSI_CVMFS_REPO", eessi_repo) setenv("EESSI_OS_TYPE", eessi_os_type) function eessiDebug(text) - if os.getenv("EESSI_DEBUG_INIT") then + if (mode() == "load" and os.getenv("EESSI_DEBUG_INIT")) then LmodMessage(text) end end @@ -82,21 +82,35 @@ local eessi_module_path = pathJoin(eessi_software_path, eessi_modules_subdir) local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") local eessi_site_module_path = pathJoin(eessi_site_software_path, eessi_modules_subdir) setenv("EPREFIX", eessi_eprefix) +eessiDebug("Setting EPREFIX to " .. eessi_eprefix) setenv("EESSI_CPU_FAMILY", eessi_cpu_family) +eessiDebug("Setting EESSI_CPU_FAMILY to " .. eessi_cpu_family) setenv("EESSI_SITE_SOFTWARE_PATH", eessi_site_software_path) +eessiDebug("Setting EESSI_SITE_SOFTWARE_PATH to " .. eessi_site_software_path) setenv("EESSI_SITE_MODULEPATH", eessi_site_module_path) +eessiDebug("Setting EESSI_SITE_MODULEPATH to " .. eessi_site_module_path) setenv("EESSI_SOFTWARE_SUBDIR", eessi_software_subdir) +eessiDebug("Setting EESSI_SOFTWARE_SUBDIR to " .. eessi_software_subdir) setenv("EESSI_PREFIX", eessi_prefix) +eessiDebug("Setting EESSI_PREFIX to " .. eessi_prefix) setenv("EESSI_EPREFIX", eessi_eprefix) +eessiDebug("Setting EPREFIX to " .. eessi_eprefix) prepend_path("PATH", pathJoin(eessi_eprefix, "bin")) -prepend_path("PATH", pathJoin(eessi_eprefix, "usr/bin")) +eessiDebug("Adding " .. pathJoin(eessi_eprefix, "bin") .. " to PATH") +prepend_path("PATH", pathJoin(eessi_eprefix, "usr", "bin")) +eessiDebug("Adding " .. pathJoin(eessi_eprefix, "usr", "bin") .. " to PATH") setenv("EESSI_SOFTWARE_PATH", eessi_software_path) +eessiDebug("Setting EESSI_SOFTWARE_PATH to " .. eessi_software_path) setenv("EESSI_MODULEPATH", eessi_module_path) +eessiDebug("Setting EESSI_MODULEPATH to " .. eessi_module_path) if ( mode() ~= "spider" ) then prepend_path("MODULEPATH", eessi_module_path) + eessiDebug("Adding " .. eessi_module_path .. " to MODULEPATH") end -prepend_path("LMOD_RC", pathJoin(eessi_software_path, "/.lmod/lmodrc.lua")) +prepend_path("LMOD_RC", pathJoin(eessi_software_path, ".lmod", "lmodrc.lua")) +eessiDebug("Adding " .. pathJoin(eessi_software_path, ".lmod", "lmodrc.lua") .. " to LMOD_RC") setenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod")) +eessiDebug("Setting LMOD_PACKAGE_PATH to " .. pathJoin(eessi_software_path, ".lmod")) -- the accelerator may have an empty value and we need to give some flexibility -- * construct the path we expect to find @@ -106,6 +120,7 @@ if not (archdetect_accel == nil or archdetect_accel == '') then eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) eessi_module_path_accel = pathJoin(eessi_accel_software_path, archdetect_accel, eessi_modules_subdir) + eessiDebug("Checking if " .. eessi_module_path_accel .. " exists") if isDir(eessi_module_path_accel) then setenv("EESSI_MODULEPATH_ACCEL", eessi_module_path_accel) prepend_path("MODULEPATH", eessi_module_path_accel) @@ -115,6 +130,7 @@ end -- prepend the site module path last so it has priority prepend_path("MODULEPATH", eessi_site_module_path) +eessiDebug("Adding " .. eessi_site_module_path .. " to MODULEPATH") if mode() == "load" then LmodMessage("EESSI/" .. eessi_version .. " loaded successfully") end From 86e0c4f2813e1e9cdc2d4b18e939361148bf5c87 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 10:05:31 +0200 Subject: [PATCH 16/34] Add debug logging to CI --- .github/workflows/tests_eessi_module.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 0fb5c656f0..67c16259db 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -96,11 +96,14 @@ jobs: # First do (and undo) the Lmod initialisation export MODULEPATH=init/modules + # Turn on debug output in case we want to take a look + export EESSI_DEBUG_INIT=true CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) export EESSI_ARCHDETECT_OPTIONS_OVERRIDE="dummy/cpu:${CPU_ARCH}:dummy1/cpu1" module load EESSI/${{matrix.EESSI_VERSION}} - # EESSI_ARCHDETECT_OPTIONS_OVERRIDE only relevant for Lmod init + # EESSI_ARCHDETECT_OPTIONS_OVERRIDE/EESSI_DEBUG_INIT only relevant for Lmod init unset EESSI_ARCHDETECT_OPTIONS_OVERRIDE + unset EESSI_DEBUG_INIT # Store all relevant environment variables env | grep -E '^EESSI_' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} @@ -139,7 +142,7 @@ jobs: EESSI_SOFTWARE_SUBDIR_OVERRIDE: - none - x86_64/amd/zen2 - - x86_64/amd/zen3 + - x86_64/amd/zen4 steps: - name: Check out software-layer repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -160,6 +163,9 @@ jobs: export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} fi + # Turn on debug output in case we want to take a look + export EESSI_DEBUG_INIT=true + initial_env_file="initial_env.txt" module_cycled_file="load_unload_cycle.txt" From 87c6cdf8ad3f275a59af6fc76c36eb1196e77582 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 10:08:17 +0200 Subject: [PATCH 17/34] Add LMOD_RC and LMOD_PACKAGE_PATH to our checks --- .github/workflows/tests_eessi_module.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 67c16259db..65a00a94a7 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -105,7 +105,7 @@ jobs: unset EESSI_ARCHDETECT_OPTIONS_OVERRIDE unset EESSI_DEBUG_INIT # Store all relevant environment variables - env | grep -E '^EESSI_' | sort > "${moduleoutfile}" + env | grep -E '(^EESSI_|^LMOD_RC|^LMOD_PACKAGE_PATH)' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} # Now do the init script initialisation From 913266293bfd2a88ead028ff96de10bc6decc7cb Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 10:11:17 +0200 Subject: [PATCH 18/34] Use the same regex everywhere --- .github/workflows/tests_eessi_module.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 65a00a94a7..75d09b74ec 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -113,7 +113,7 @@ jobs: # source script version sets environment variables to force archdetect, ignore these unset EESSI_USE_ARCHSPEC unset EESSI_USE_ARCHDETECT - env | grep -E '^EESSI_' | sort > "${sourceoutfile}" + env | grep -E '(^EESSI_|^LMOD_RC|^LMOD_PACKAGE_PATH)' | sort > "${sourceoutfile}" # Now compare the two results echo "" @@ -170,14 +170,14 @@ jobs: module_cycled_file="load_unload_cycle.txt" # Store the initial environment - env | grep -E '^EESSI_' | sort > "${initial_env_file}" + env | grep -E '(^EESSI_|^LMOD_RC|^LMOD_PACKAGE_PATH)' | sort > "${initial_env_file}" # Do (and undo) loading the EESSI module export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) module load EESSI/${{matrix.EESSI_VERSION}} module unload EESSI/${{matrix.EESSI_VERSION}} - env | grep -E '^EESSI_' | sort > "${module_cycled_file}" + env | grep -E '(^EESSI_|^LMOD_RC|^LMOD_PACKAGE_PATH)' | sort > "${module_cycled_file}" # Now compare the two results echo "" From b8c311d5254a5c7324f65dd5f090f45ab5ea2a1b Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 10:17:17 +0200 Subject: [PATCH 19/34] zen4 is currently an exception, let's explicitly add it to the tests --- .github/workflows/tests_eessi_module.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 75d09b74ec..e74ad8587f 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -70,6 +70,7 @@ jobs: - 2023.06 EESSI_SOFTWARE_SUBDIR_OVERRIDE: - x86_64/amd/zen3 + - x86_64/amd/zen4 EESSI_ACCELERATOR_TARGET_OVERRIDE: - accel/nvidia/cc80 steps: From fe6a7def8986ad5bddae1abc71466fef0ce3aba8 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 10:46:42 +0200 Subject: [PATCH 20/34] Allow overriding to use Zen4 --- init/modules/EESSI/2023.06.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 55a77335fc..598c436785 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -41,7 +41,7 @@ function archdetect_cpu() -- use x86_64/amd/zen3 for now when AMD Genoa (Zen4) CPU is detected, -- since optimized software installations for Zen4 are a work-in-progress, -- see https://gitlab.com/eessi/support/-/issues/37 - if archdetect_filter_cpu == "x86_64/amd/zen4" then + if (archdetect_filter_cpu == "x86_64/amd/zen4" and not os.getenv("EESSI_SOFTWARE_SUBDIR_OVERRIDE") == "x86_64/amd/zen4") then archdetect_filter_cpu = "x86_64/amd/zen3" if mode() == "load" then LmodMessage("Sticking to " .. archdetect_filter_cpu .. " for now, since optimized installations for AMD Genoa (Zen4) are a work in progress.") From 6d64c4283c1de2fa7b9c51a1d53e78e18c7b5ae3 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 16 Oct 2024 11:51:39 +0200 Subject: [PATCH 21/34] Add comment to loop for clarification --- init/modules/EESSI/2023.06.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 598c436785..83e3791947 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -36,6 +36,9 @@ function archdetect_cpu() archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or archdetect_options if archdetect_options then eessiDebug("Got archdetect CPU options: " .. archdetect_options) + -- archdetect_options is a colon-separated list of CPU architectures that are compatible with + -- the host CPU and ordered from most specific to least specific, e.g., + -- x86_64/intel/skylake_avx512:x86_64/intel/haswell:x86_64/generic for archdetect_filter_cpu in string.gmatch(archdetect_options, "([^" .. ":" .. "]+)") do if isDir(pathJoin(eessi_prefix, "software", eessi_os_type, archdetect_filter_cpu, "software")) then -- use x86_64/amd/zen3 for now when AMD Genoa (Zen4) CPU is detected, From 7e4f901762cd7981740da8c2f8b5cc9413f0c2df Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 16 Oct 2024 12:15:20 +0200 Subject: [PATCH 22/34] Add comments with examples in lots of places --- init/modules/EESSI/2023.06.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 83e3791947..878850aee3 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -38,7 +38,8 @@ function archdetect_cpu() eessiDebug("Got archdetect CPU options: " .. archdetect_options) -- archdetect_options is a colon-separated list of CPU architectures that are compatible with -- the host CPU and ordered from most specific to least specific, e.g., - -- x86_64/intel/skylake_avx512:x86_64/intel/haswell:x86_64/generic + -- x86_64/intel/skylake_avx512:x86_64/intel/haswell:x86_64/generic + -- We loop over the list, and return the highest matching arch for which a directory exists for this EESSI version for archdetect_filter_cpu in string.gmatch(archdetect_options, "([^" .. ":" .. "]+)") do if isDir(pathJoin(eessi_prefix, "software", eessi_os_type, archdetect_filter_cpu, "software")) then -- use x86_64/amd/zen3 for now when AMD Genoa (Zen4) CPU is detected, @@ -74,15 +75,23 @@ function archdetect_accel() eessiDebug("Got archdetect accel option: " .. archdetect_accel) return archdetect_accel end +-- archdetect finds the best compatible architecture, e.g., x86_64/amd/zen3 local archdetect = archdetect_cpu() +-- archdetect_accel() attempts to identify an accelerator, e.g., accel/nvidia/cc80 local archdetect_accel = archdetect_accel() +-- eessi_cpu_family is derived from the archdetect match, e.g., x86_64 local eessi_cpu_family = archdetect:match("([^/]+)") local eessi_software_subdir = archdetect +-- eessi_eprefix is the base location of the compat layer, e.g., /cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64 local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family) +-- eessi_software_path is the location of the software installations, e.g., +-- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) local eessi_modules_subdir = pathJoin("modules", "all") local eessi_module_path = pathJoin(eessi_software_path, eessi_modules_subdir) local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") +-- Site module path is the same as the EESSI one, but with `versions` changed to `host_injections`, e.g., +-- /cvmfs/software.eessi.io/host_injections/2023.06/software/linux/x86_64/amd/zen3/modules/all local eessi_site_module_path = pathJoin(eessi_site_software_path, eessi_modules_subdir) setenv("EPREFIX", eessi_eprefix) eessiDebug("Setting EPREFIX to " .. eessi_eprefix) @@ -106,6 +115,7 @@ setenv("EESSI_SOFTWARE_PATH", eessi_software_path) eessiDebug("Setting EESSI_SOFTWARE_PATH to " .. eessi_software_path) setenv("EESSI_MODULEPATH", eessi_module_path) eessiDebug("Setting EESSI_MODULEPATH to " .. eessi_module_path) +-- We ship our spider cache, so this location does not need to be spider-ed if ( mode() ~= "spider" ) then prepend_path("MODULEPATH", eessi_module_path) eessiDebug("Adding " .. eessi_module_path .. " to MODULEPATH") @@ -120,8 +130,11 @@ eessiDebug("Setting LMOD_PACKAGE_PATH to " .. pathJoin(eessi_software_path, ".lm -- * then check it exists -- * then update the modulepath if not (archdetect_accel == nil or archdetect_accel == '') then + -- The CPU subdirectory of the accelerator installations is _usually_ the same as host CPU, but this can be overridden eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) + -- location of the accelerator modules, e.g., + -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/accel/nvidia/cc80/modules/all eessi_module_path_accel = pathJoin(eessi_accel_software_path, archdetect_accel, eessi_modules_subdir) eessiDebug("Checking if " .. eessi_module_path_accel .. " exists") if isDir(eessi_module_path_accel) then From 089158a67beca03731fb280c347c72bc0fdd47e6 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 16 Oct 2024 12:15:52 +0200 Subject: [PATCH 23/34] Apply suggestions from code review --- init/modules/EESSI/2023.06.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 878850aee3..c45ae743f5 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -132,6 +132,8 @@ eessiDebug("Setting LMOD_PACKAGE_PATH to " .. pathJoin(eessi_software_path, ".lm if not (archdetect_accel == nil or archdetect_accel == '') then -- The CPU subdirectory of the accelerator installations is _usually_ the same as host CPU, but this can be overridden eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir + -- CPU location of the accelerator installations, e.g., + -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) -- location of the accelerator modules, e.g., -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/accel/nvidia/cc80/modules/all From bea886b618515416f114ac267b177396412fda41 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 16 Oct 2024 12:16:38 +0200 Subject: [PATCH 24/34] Apply suggestions from code review --- init/modules/EESSI/2023.06.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index c45ae743f5..0c2f34280a 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -88,6 +88,8 @@ local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_ -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) local eessi_modules_subdir = pathJoin("modules", "all") +-- eessi_module_path is the location of the _CPU_ module files, e.g., +-- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/modules/all local eessi_module_path = pathJoin(eessi_software_path, eessi_modules_subdir) local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") -- Site module path is the same as the EESSI one, but with `versions` changed to `host_injections`, e.g., From 6e1ccaa36e028b81e9a58b1958ca2f3102ba1a1b Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 12:28:34 +0200 Subject: [PATCH 25/34] Add more cases to load/unload tests, and check full env --- .github/workflows/tests_eessi_module.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index e74ad8587f..de99543f6d 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -144,6 +144,9 @@ jobs: - none - x86_64/amd/zen2 - x86_64/amd/zen4 + EESSI_ACCELERATOR_TARGET_OVERRIDE: + - none + - accel/nvidia/cc80 steps: - name: Check out software-layer repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -159,11 +162,16 @@ jobs: run: | . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod - # Set our path overrides according to our matrix + # Set our cpu path overrides according to our matrix if [[ "${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}" != "none" ]]; then export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} fi + # Set our accelerator path overrides according to our matrix + if [[ "${{matrix.EESSI_ACCELERATOR_TARGET_OVERRIDE}}" != "none" ]]; then + export EESSI_ACCELERATOR_TARGET_OVERRIDE=${{matrix.EESSI_ACCELERATOR_TARGET_OVERRIDE}} + fi + # Turn on debug output in case we want to take a look export EESSI_DEBUG_INIT=true @@ -171,14 +179,14 @@ jobs: module_cycled_file="load_unload_cycle.txt" # Store the initial environment - env | grep -E '(^EESSI_|^LMOD_RC|^LMOD_PACKAGE_PATH)' | sort > "${initial_env_file}" + env | sort > "${initial_env_file}" # Do (and undo) loading the EESSI module export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) module load EESSI/${{matrix.EESSI_VERSION}} module unload EESSI/${{matrix.EESSI_VERSION}} - env | grep -E '(^EESSI_|^LMOD_RC|^LMOD_PACKAGE_PATH)' | sort > "${module_cycled_file}" + env | sort > "${module_cycled_file}" # Now compare the two results echo "" From 84d9f1deabbb366ba8799dbc7d26f45f4b6ae157 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 12:46:55 +0200 Subject: [PATCH 26/34] Make sure Lmod has run once before storing environment settings --- .github/workflows/tests_eessi_module.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index de99543f6d..807c16eb8e 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -45,7 +45,8 @@ jobs: - name: Test for archdetect_cpu functionality with invalid path run: | - . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + # Initialise Lmod + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash export MODULEPATH=init/modules set +e # Do not exit immediately if a command exits with a non-zero status export EESSI_ARCHDETECT_OPTIONS_OVERRIDE="dummy/cpu" @@ -86,7 +87,8 @@ jobs: - name: Test for expected variables match between Lmod init script and original bash script run: | - . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + # Initialise Lmod + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Set our path overrides according to our matrix export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} @@ -160,7 +162,8 @@ jobs: - name: Test for identical environment after loading and unloading the EESSI module run: | - . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + # Initialise Lmod + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Set our cpu path overrides according to our matrix if [[ "${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}" != "none" ]]; then @@ -178,11 +181,14 @@ jobs: initial_env_file="initial_env.txt" module_cycled_file="load_unload_cycle.txt" + # prepare Lmod + export MODULEPATH=init/modules + module list + # Store the initial environment env | sort > "${initial_env_file}" # Do (and undo) loading the EESSI module - export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) module load EESSI/${{matrix.EESSI_VERSION}} module unload EESSI/${{matrix.EESSI_VERSION}} From 56518eac74c1d4790e74662a0562016394b16d3e Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 12:54:25 +0200 Subject: [PATCH 27/34] Don't expose full environment in CI --- .github/workflows/tests_eessi_module.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 807c16eb8e..91760b6c04 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -194,15 +194,7 @@ jobs: module unload EESSI/${{matrix.EESSI_VERSION}} env | sort > "${module_cycled_file}" - # Now compare the two results - echo "" - echo "Initial environment:" - cat "${initial_env_file}" - echo "" - echo "Environment after load/unload cycle of EESSI:" - cat "${module_cycled_file}" - echo "" - echo "" + # Now compare the two results (do not expose the files, as they contain the full environment!) if (diff "${initial_env_file}" "${module_cycled_file}" > /dev/null); then echo "Test for checking env variables PASSED" else From 946528974bbb7a0492fa31649761dcd16ca52cd9 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 12:58:29 +0200 Subject: [PATCH 28/34] Try harder to initialise Lmod before checking load/unload --- .github/workflows/tests_eessi_module.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 91760b6c04..acc903c878 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -183,6 +183,7 @@ jobs: # prepare Lmod export MODULEPATH=init/modules + module reset module list # Store the initial environment From e937d5b8bd549d3525dbe2149737473a75c39f57 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 13:04:56 +0200 Subject: [PATCH 29/34] Make sure a module reset does not return an error --- .github/workflows/tests_eessi_module.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index acc903c878..2c4dbca88c 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -181,9 +181,9 @@ jobs: initial_env_file="initial_env.txt" module_cycled_file="load_unload_cycle.txt" - # prepare Lmod + # prepare Lmod, including resetting it (even though this will likely return an error since we have no defaults) export MODULEPATH=init/modules - module reset + module reset || true module list # Store the initial environment From fb59a5537e76e2eb14e06c4fbda92cba0402e5b5 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 13:12:44 +0200 Subject: [PATCH 30/34] Try another way to reset Lmod --- .github/workflows/tests_eessi_module.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 2c4dbca88c..8d9909bfdf 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -183,8 +183,8 @@ jobs: # prepare Lmod, including resetting it (even though this will likely return an error since we have no defaults) export MODULEPATH=init/modules - module reset || true - module list + module purge + module avail # Store the initial environment env | sort > "${initial_env_file}" From c02d894ce47608f6cf1b116ddedf1c22b3dd8c3f Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 13:19:56 +0200 Subject: [PATCH 31/34] Add a fake module so we can initialise Lmod somehow --- .github/workflows/modules/fake_module.lua | 1 + .github/workflows/tests_eessi_module.yml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/modules/fake_module.lua diff --git a/.github/workflows/modules/fake_module.lua b/.github/workflows/modules/fake_module.lua new file mode 100644 index 0000000000..f23a69c008 --- /dev/null +++ b/.github/workflows/modules/fake_module.lua @@ -0,0 +1 @@ +setenv("INSIDE_GITHUB_ACTIONS", "true") diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 8d9909bfdf..89e48187cb 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -181,9 +181,11 @@ jobs: initial_env_file="initial_env.txt" module_cycled_file="load_unload_cycle.txt" - # prepare Lmod, including resetting it (even though this will likely return an error since we have no defaults) - export MODULEPATH=init/modules + # prepare Lmod, resetting it in a roundabout way + export MODULEPATH=init/modules:.github/workflows/modules + module load fake_module module purge + module unuse .github/workflows/modules module avail # Store the initial environment From 6b9d9809d6cadd4513d165bdc9213f5efa4883a0 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 13:24:25 +0200 Subject: [PATCH 32/34] Keep trying to figure out how to control Lmod --- .github/workflows/modules/fake_module.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/modules/fake_module.lua b/.github/workflows/modules/fake_module.lua index f23a69c008..e45cb640d6 100644 --- a/.github/workflows/modules/fake_module.lua +++ b/.github/workflows/modules/fake_module.lua @@ -1 +1,3 @@ setenv("INSIDE_GITHUB_ACTIONS", "true") +-- Interfere with PATH so Lmod keeps a record +prepend_path("PATH", "/snap/bin") From 834ce38c5628a56d0057300fd046a63a5b17ef53 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 13:29:25 +0200 Subject: [PATCH 33/34] Ignore Lmod tables when doing environment comparison --- .github/workflows/tests_eessi_module.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 89e48187cb..2bf4b39bde 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -181,21 +181,21 @@ jobs: initial_env_file="initial_env.txt" module_cycled_file="load_unload_cycle.txt" - # prepare Lmod, resetting it in a roundabout way + # prepare Lmod, resetting it in a roundabout given we don't want defaults set export MODULEPATH=init/modules:.github/workflows/modules module load fake_module module purge module unuse .github/workflows/modules module avail - # Store the initial environment - env | sort > "${initial_env_file}" + # Store the initial environment (ignoring Lmod tables) + env | grep -v _ModuleTable | sort > "${initial_env_file}" # Do (and undo) loading the EESSI module CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) module load EESSI/${{matrix.EESSI_VERSION}} module unload EESSI/${{matrix.EESSI_VERSION}} - env | sort > "${module_cycled_file}" + env | grep -v _ModuleTable | sort > "${module_cycled_file}" # Now compare the two results (do not expose the files, as they contain the full environment!) if (diff "${initial_env_file}" "${module_cycled_file}" > /dev/null); then From 04c25738137a041a0bda39ba80f7e291c2e72833 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 16 Oct 2024 16:35:21 +0200 Subject: [PATCH 34/34] Update 2023.06.lua --- init/modules/EESSI/2023.06.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 0c2f34280a..348699c0f1 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -124,7 +124,8 @@ if ( mode() ~= "spider" ) then end prepend_path("LMOD_RC", pathJoin(eessi_software_path, ".lmod", "lmodrc.lua")) eessiDebug("Adding " .. pathJoin(eessi_software_path, ".lmod", "lmodrc.lua") .. " to LMOD_RC") -setenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod")) +-- Use pushenv for LMOD_PACKAGE_PATH as this may be set locally by the site +pushenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod")) eessiDebug("Setting LMOD_PACKAGE_PATH to " .. pathJoin(eessi_software_path, ".lmod")) -- the accelerator may have an empty value and we need to give some flexibility