From 53d5e26d84f57ecc425f2c6a441a793df83930a7 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 14 Aug 2024 17:32:29 +0200 Subject: [PATCH 01/18] Fix test_suite not being able to retrieve memory on systems that use cgroups v2 --- test_suite.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index 6e73fbd87c..cfaec82026 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -157,7 +157,13 @@ if [[ "${cpuinfo}" =~ (Core\(s\) per socket:[^0-9]*([0-9]+)) ]]; then 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/$( Date: Wed, 14 Aug 2024 17:36:40 +0200 Subject: [PATCH 02/18] Add something in order to prove that this fixes the test --- .../2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml b/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml index 9d13d5eb3a..695c4a06d9 100644 --- a/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml +++ b/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml @@ -22,3 +22,4 @@ easyconfigs: # see https://github.com/easybuilders/easybuild-easyconfigs/pull/21136 from-commit: d8076ebaf8cb915762adebf88d385cc672b350dc - MODFLOW-6.4.4-foss-2023a.eb + - gnuplot-5.4.8-GCCcore-12.3.0.eb From 4e52f59e1e90988a3721e8bf768a1f8d60182c6b Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 14 Aug 2024 17:41:19 +0200 Subject: [PATCH 03/18] Fix if-else syntax --- test_suite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index cfaec82026..5749e5c995 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -161,7 +161,7 @@ cgroup_v1_mem_limit="/sys/fs/cgroup/memory/$( Date: Thu, 15 Aug 2024 11:46:03 +0200 Subject: [PATCH 04/18] If max is specified in the cgroupsv2 file, just get the system memory --- test_suite.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index 5749e5c995..02b22361db 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -163,10 +163,19 @@ if [ -f "$cgroup_v1_mem_limit" ]; then cgroup_mem_bytes=$(cat "$cgroup_v1_mem_limit") else cgroup_mem_bytes=$(cat "$cgroup_v2_mem_limit") + if [ "$cgroup_mem_bytes" = 'max' ]; then + # In cgroupsv2, the memory.max file may contain 'max', meaning the group can use the full system memory + # Here, we get the system memory from /proc/meminfo. Units are supposedly always in kb, but lets match them too + cgroup_mem_kilobytes=$(grep -oP 'MemTotal:\s+\K\d+(?=\s+kB)' /proc/meminfo) + if [[ $? -eq 0 ]] || [[ -z "$cgroup_mem_kilobytes" ]]; then + fatal_error "Failed to get memory limit from /proc/meminfo" + fi + cgroup_mem_bytes=$(("$cgroup_mem_kilobytes"*1024)) + fi fi if [[ $? -eq 0 ]]; then # Convert to MiB - cgroup_mem_mib=$((cgroup_mem_bytes/(1024*1024))) + cgroup_mem_mib=$(("$cgroup_mem_bytes"/(1024*1024))) else fatal_error "Failed to get the memory limit in bytes from the current cgroup" fi From e69642c1e450bc4a6803c83fedc2a15843a398e2 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 13:05:00 +0200 Subject: [PATCH 05/18] Correct bash test --- test_suite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index 02b22361db..2986e37f7b 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -167,7 +167,7 @@ else # In cgroupsv2, the memory.max file may contain 'max', meaning the group can use the full system memory # Here, we get the system memory from /proc/meminfo. Units are supposedly always in kb, but lets match them too cgroup_mem_kilobytes=$(grep -oP 'MemTotal:\s+\K\d+(?=\s+kB)' /proc/meminfo) - if [[ $? -eq 0 ]] || [[ -z "$cgroup_mem_kilobytes" ]]; then + if [[ $? -ne 0 ]]; then || [[ -z "$cgroup_mem_kilobytes" ]]; then fatal_error "Failed to get memory limit from /proc/meminfo" fi cgroup_mem_bytes=$(("$cgroup_mem_kilobytes"*1024)) From b1902b34161455ef0f77880346ef14aa033bb6f9 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 13:07:50 +0200 Subject: [PATCH 06/18] Fix syntax error --- test_suite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index 2986e37f7b..847f5ea18e 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -167,7 +167,7 @@ else # In cgroupsv2, the memory.max file may contain 'max', meaning the group can use the full system memory # Here, we get the system memory from /proc/meminfo. Units are supposedly always in kb, but lets match them too cgroup_mem_kilobytes=$(grep -oP 'MemTotal:\s+\K\d+(?=\s+kB)' /proc/meminfo) - if [[ $? -ne 0 ]]; then || [[ -z "$cgroup_mem_kilobytes" ]]; then + if [[ $? -ne 0 ]] || [[ -z "$cgroup_mem_kilobytes" ]]; then fatal_error "Failed to get memory limit from /proc/meminfo" fi cgroup_mem_bytes=$(("$cgroup_mem_kilobytes"*1024)) From 8f39d6f9814f3e3ad30c46277b62a4cf17168f2f Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 14:42:39 +0200 Subject: [PATCH 07/18] Exclude TensorFlow test for now, it seems to get stuck. First lets make sure we run the test suite on the zen4 prefix... --- test_suite.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index 847f5ea18e..7598d9fad0 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -209,7 +209,9 @@ fi # Run all tests echo "Running tests: reframe ${REFRAME_ARGS} --run" -reframe ${REFRAME_ARGS} --run +# Exclude TensorFlow, which got stuck on https://github.com/EESSI/software-layer/pull/670#issuecomment-2291084266 +# Let's first make sure the test suite runs on the zen4 prefix... +reframe ${REFRAME_ARGS} --run --exclude TensorFlow reframe_exit_code=$? if [[ ${reframe_exit_code} -eq 0 ]]; then echo_green "ReFrame runtime ran succesfully with command: reframe ${REFRAME_ARGS} --run." From 932d9a09e17b8798948522d0d3a1e0dfc4c0bc13 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 15:06:05 +0200 Subject: [PATCH 08/18] Add some debugging echo's --- test_suite.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index 7598d9fad0..69002bdbb5 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -74,8 +74,13 @@ fi TMPDIR=$(mktemp -d) echo ">> Setting up environment..." -module --force purge +# No module command, we are outside of the compat layer +# module --force purge +echo "Current EESSI env:" +env | grep "EESSI" +echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE before calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) +echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE after calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" source $TOPDIR/init/bash From 8eb07102bf23d9f3dee1146cafb947823b4144f5 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 15:31:10 +0200 Subject: [PATCH 09/18] Make sure test suite only lists. Also make sure python script that uses archspec is called in a shell that has EESSI initialized, so that archspec is available --- test_suite.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test_suite.sh b/test_suite.sh index 69002bdbb5..6845b230ef 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -79,7 +79,9 @@ echo ">> Setting up environment..." echo "Current EESSI env:" env | grep "EESSI" echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE before calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" -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; python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE after calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" source $TOPDIR/init/bash @@ -216,7 +218,9 @@ fi echo "Running tests: reframe ${REFRAME_ARGS} --run" # Exclude TensorFlow, which got stuck on https://github.com/EESSI/software-layer/pull/670#issuecomment-2291084266 # Let's first make sure the test suite runs on the zen4 prefix... -reframe ${REFRAME_ARGS} --run --exclude TensorFlow +#reframe ${REFRAME_ARGS} --run --exclude TensorFlow +# Limit to listing again, until we are sure we run with zen4... +reframe ${REFRAME_ARGS} --list reframe_exit_code=$? if [[ ${reframe_exit_code} -eq 0 ]]; then echo_green "ReFrame runtime ran succesfully with command: reframe ${REFRAME_ARGS} --run." From 584c637f2ae87f39bf0d50a0ae8c639d7c1a370b Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 16:14:57 +0200 Subject: [PATCH 10/18] Redirect the output from sourcing the init script, as that is not what we want to capture in the environment variable --- test_suite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suite.sh b/test_suite.sh index 6845b230ef..86a347931b 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -81,7 +81,7 @@ env | grep "EESSI" echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE before calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" # 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; python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) +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 after calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" source $TOPDIR/init/bash From faddc7515ea0cf28ab8bd65da15980eb61c6786c Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 17:13:17 +0200 Subject: [PATCH 11/18] Remove debugging echo's --- test_suite.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test_suite.sh b/test_suite.sh index 86a347931b..f9f6d0113a 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -74,10 +74,6 @@ fi TMPDIR=$(mktemp -d) echo ">> Setting up environment..." -# No module command, we are outside of the compat layer -# module --force purge -echo "Current EESSI env:" -env | grep "EESSI" echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE before calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" # 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) From bd24ca8e613aa9f511c64f2689aff037e06cc2b6 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 17:24:59 +0200 Subject: [PATCH 12/18] Remove gnuplot and add ReFrame --- .../2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml | 2 ++ .../2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml diff --git a/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml b/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml new file mode 100644 index 0000000000..f1fde247d0 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml @@ -0,0 +1,2 @@ +easyconfigs: + - ReFrame-4.3.3.eb diff --git a/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml b/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml index 695c4a06d9..9d13d5eb3a 100644 --- a/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml +++ b/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-2023a.yml @@ -22,4 +22,3 @@ easyconfigs: # see https://github.com/easybuilders/easybuild-easyconfigs/pull/21136 from-commit: d8076ebaf8cb915762adebf88d385cc672b350dc - MODFLOW-6.4.4-foss-2023a.eb - - gnuplot-5.4.8-GCCcore-12.3.0.eb From 9845452b29054d5739d2e89abafaa5e1ea4410c2 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 15 Aug 2024 18:32:40 +0200 Subject: [PATCH 13/18] Debugging issue with loading ReFrame --- test_suite.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test_suite.sh b/test_suite.sh index f9f6d0113a..fe08f7bf83 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -82,6 +82,14 @@ echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE after calling eessi_software_subdir.py: $EE source $TOPDIR/init/bash +# DEBUGGING +echo "Checking if ReFrame module exists:" +ls -al /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen4/modules/all/ReFrame/4.3.3.lua +echo "Checking available ReFrame modules" +module av ReFrame +echo "Checking if we can load ReFrame when ignoring the cache" +module load --ignore_cache ReFrame + # Load the ReFrame module # Currently, we load the default version. Maybe we should somehow make this configurable in the future? module load ReFrame From ab203e2e125857e824d9e9e7c38a6db350276cac Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 19 Aug 2024 11:35:21 +0200 Subject: [PATCH 14/18] Add gnuplot back in as test build --- .../2023.06/eessi-2023.06-eb-4.9.2-2023a.yml | 1 + .../map_software_to_test.py | 57 +++++++++++++++++++ .../eessi_test_mapping/software_to_tests.yml | 7 +++ tests/eessi_test_mapping/test_mapping.yml | 5 ++ 4 files changed, 70 insertions(+) create mode 100644 tests/eessi_test_mapping/map_software_to_test.py create mode 100644 tests/eessi_test_mapping/software_to_tests.yml create mode 100644 tests/eessi_test_mapping/test_mapping.yml diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml index e8fe8ab120..e13b1935fd 100644 --- a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml @@ -45,3 +45,4 @@ easyconfigs: options: # see https://github.com/easybuilders/easybuild-easyconfigs/pull/20880 from-commit: bc6e08f89759b8b70166de5bfcb5056b9db8ec90 + - gnuplot-5.4.8-GCCcore-12.3.0.eb diff --git a/tests/eessi_test_mapping/map_software_to_test.py b/tests/eessi_test_mapping/map_software_to_test.py new file mode 100644 index 0000000000..464921b11b --- /dev/null +++ b/tests/eessi_test_mapping/map_software_to_test.py @@ -0,0 +1,57 @@ +import yaml +import re +import os + +def load_mappings(file_path): + """Load the YAML mappings from a file.""" + with open(file_path, 'r') as file: + config = yaml.safe_load(file) + return config['mappings'] + +def get_tests_for_software(software_name, mappings): + """Get the list of tests for a given software name based on the first matching regex pattern.""" + + # Iterate over patterns in the order they appear in the YAML file + for pattern, tests in mappings.items(): + if re.match(pattern, software_name): + return tests + + # If no matches are found, return the default tests if they exist + if 'default_tests' in mappings: + return mappings['default_tests'] + + return [] + +def read_software_names(file_path): + """Read software names from the module_files.list.txt file.""" + with open(file_path, 'r') as file: + software_names = [line.strip() for line in file if line.strip()] + return software_names + +if __name__ == "__main__": + mappings = load_mappings("software_to_tests.yml") + + # Check if the file module_files.list.txt exists + module_file_path = "module_files.list.txt" + if not os.path.exists(module_file_path): + print(f"Error: {module_file_path} does not exist.") + else: + software_names = read_software_names(module_file_path) + tests_to_run = [] + for software_name in software_names: + additional_tests = get_tests_for_software(software_name, mappings) + for test in additional_tests: + if test not in tests_to_run: + tests_to_run.append(test) + + if additional_tests: + print(f"Software: {software_name} -> Tests: {additional_tests}") + else: + print(f"Software: {software_name} -> No tests found") + + if tests_to_run: + arg_string = " ".join([f"-n {test_name}" for test_name in tests_to_run]) + print(f"Full list of tests to run: {tests_to_run}") + print(f"Argument string: {arg_string}") + else: + print(f"Full list of tests to run: No tests found") diff --git a/tests/eessi_test_mapping/software_to_tests.yml b/tests/eessi_test_mapping/software_to_tests.yml new file mode 100644 index 0000000000..2c6d504fae --- /dev/null +++ b/tests/eessi_test_mapping/software_to_tests.yml @@ -0,0 +1,7 @@ +mappings: + gnuplot/*: + - EESSI_ESPRESSO + Perl/*: + - EESSI_GROMACS + default_tests: + - EESSI_OSU diff --git a/tests/eessi_test_mapping/test_mapping.yml b/tests/eessi_test_mapping/test_mapping.yml new file mode 100644 index 0000000000..603e765a64 --- /dev/null +++ b/tests/eessi_test_mapping/test_mapping.yml @@ -0,0 +1,5 @@ +mappings: + - gnuplot/*: + - EESSI_ESPRESSO + - Perl/*: + - EESSI_GROMACS From cd0c6c6dedfebd884a6df96f0b5f796dbf029789 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 19 Aug 2024 11:36:10 +0200 Subject: [PATCH 15/18] Remove ReFrame, as that was now build and deployed in a separate PR --- .../2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml diff --git a/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml b/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml deleted file mode 100644 index f1fde247d0..0000000000 --- a/easystacks/software.eessi.io/2023.06/zen4/eessi-2023.06-eb-4.9.2-001-system.yml +++ /dev/null @@ -1,2 +0,0 @@ -easyconfigs: - - ReFrame-4.3.3.eb From 6f63aea97a24571d87f1017d1af2b5decad6203a Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 19 Aug 2024 11:48:17 +0200 Subject: [PATCH 16/18] These files belonged to another PR... --- .../map_software_to_test.py | 57 ------------------- .../eessi_test_mapping/software_to_tests.yml | 7 --- tests/eessi_test_mapping/test_mapping.yml | 5 -- 3 files changed, 69 deletions(-) delete mode 100644 tests/eessi_test_mapping/map_software_to_test.py delete mode 100644 tests/eessi_test_mapping/software_to_tests.yml delete mode 100644 tests/eessi_test_mapping/test_mapping.yml diff --git a/tests/eessi_test_mapping/map_software_to_test.py b/tests/eessi_test_mapping/map_software_to_test.py deleted file mode 100644 index 464921b11b..0000000000 --- a/tests/eessi_test_mapping/map_software_to_test.py +++ /dev/null @@ -1,57 +0,0 @@ -import yaml -import re -import os - -def load_mappings(file_path): - """Load the YAML mappings from a file.""" - with open(file_path, 'r') as file: - config = yaml.safe_load(file) - return config['mappings'] - -def get_tests_for_software(software_name, mappings): - """Get the list of tests for a given software name based on the first matching regex pattern.""" - - # Iterate over patterns in the order they appear in the YAML file - for pattern, tests in mappings.items(): - if re.match(pattern, software_name): - return tests - - # If no matches are found, return the default tests if they exist - if 'default_tests' in mappings: - return mappings['default_tests'] - - return [] - -def read_software_names(file_path): - """Read software names from the module_files.list.txt file.""" - with open(file_path, 'r') as file: - software_names = [line.strip() for line in file if line.strip()] - return software_names - -if __name__ == "__main__": - mappings = load_mappings("software_to_tests.yml") - - # Check if the file module_files.list.txt exists - module_file_path = "module_files.list.txt" - if not os.path.exists(module_file_path): - print(f"Error: {module_file_path} does not exist.") - else: - software_names = read_software_names(module_file_path) - tests_to_run = [] - for software_name in software_names: - additional_tests = get_tests_for_software(software_name, mappings) - for test in additional_tests: - if test not in tests_to_run: - tests_to_run.append(test) - - if additional_tests: - print(f"Software: {software_name} -> Tests: {additional_tests}") - else: - print(f"Software: {software_name} -> No tests found") - - if tests_to_run: - arg_string = " ".join([f"-n {test_name}" for test_name in tests_to_run]) - print(f"Full list of tests to run: {tests_to_run}") - print(f"Argument string: {arg_string}") - else: - print(f"Full list of tests to run: No tests found") diff --git a/tests/eessi_test_mapping/software_to_tests.yml b/tests/eessi_test_mapping/software_to_tests.yml deleted file mode 100644 index 2c6d504fae..0000000000 --- a/tests/eessi_test_mapping/software_to_tests.yml +++ /dev/null @@ -1,7 +0,0 @@ -mappings: - gnuplot/*: - - EESSI_ESPRESSO - Perl/*: - - EESSI_GROMACS - default_tests: - - EESSI_OSU diff --git a/tests/eessi_test_mapping/test_mapping.yml b/tests/eessi_test_mapping/test_mapping.yml deleted file mode 100644 index 603e765a64..0000000000 --- a/tests/eessi_test_mapping/test_mapping.yml +++ /dev/null @@ -1,5 +0,0 @@ -mappings: - - gnuplot/*: - - EESSI_ESPRESSO - - Perl/*: - - EESSI_GROMACS From 4fef822203aed8a523771d14afa7b7d51f628c72 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 19 Aug 2024 12:05:34 +0200 Subject: [PATCH 17/18] Remove gnuplot again, it was already present... --- .../2023.06/eessi-2023.06-eb-4.9.2-2023a.yml | 1 - test_suite.sh | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml index e13b1935fd..e8fe8ab120 100644 --- a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023a.yml @@ -45,4 +45,3 @@ easyconfigs: options: # see https://github.com/easybuilders/easybuild-easyconfigs/pull/20880 from-commit: bc6e08f89759b8b70166de5bfcb5056b9db8ec90 - - gnuplot-5.4.8-GCCcore-12.3.0.eb diff --git a/test_suite.sh b/test_suite.sh index fe08f7bf83..fffd4a7888 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -220,11 +220,7 @@ fi # Run all tests echo "Running tests: reframe ${REFRAME_ARGS} --run" -# Exclude TensorFlow, which got stuck on https://github.com/EESSI/software-layer/pull/670#issuecomment-2291084266 -# Let's first make sure the test suite runs on the zen4 prefix... -#reframe ${REFRAME_ARGS} --run --exclude TensorFlow -# Limit to listing again, until we are sure we run with zen4... -reframe ${REFRAME_ARGS} --list +reframe ${REFRAME_ARGS} --run reframe_exit_code=$? if [[ ${reframe_exit_code} -eq 0 ]]; then echo_green "ReFrame runtime ran succesfully with command: reframe ${REFRAME_ARGS} --run." From 634abb077d9f0283f6452c4bcb35e1e3f7b30fd4 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 19 Aug 2024 14:39:21 +0200 Subject: [PATCH 18/18] Be a bit more verbose, for easier debugging of future issues. Remove statements that were inserted just to debug this particular issue --- test_suite.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test_suite.sh b/test_suite.sh index fffd4a7888..464670b653 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -74,22 +74,13 @@ fi TMPDIR=$(mktemp -d) echo ">> Setting up environment..." -echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE before calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" # 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 after calling eessi_software_subdir.py: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" +echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE: $EESSI_SOFTWARE_SUBDIR_OVERRIDE" source $TOPDIR/init/bash -# DEBUGGING -echo "Checking if ReFrame module exists:" -ls -al /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen4/modules/all/ReFrame/4.3.3.lua -echo "Checking available ReFrame modules" -module av ReFrame -echo "Checking if we can load ReFrame when ignoring the cache" -module load --ignore_cache ReFrame - # Load the ReFrame module # Currently, we load the default version. Maybe we should somehow make this configurable in the future? module load ReFrame @@ -147,24 +138,29 @@ 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 @@ -190,12 +186,18 @@ if [[ $? -eq 0 ]]; then else fatal_error "Failed to get the memory limit in bytes from the current cgroup" fi +echo "Detected available memory: ${cgroup_mem_mib} MiB" + +echo "Replacing detected system information in template ReFrame config file..." cp ${RFM_CONFIG_FILE_TEMPLATE} ${RFM_CONFIG_FILES} sed -i "s/__NUM_CPUS__/${cpu_count}/g" $RFM_CONFIG_FILES sed -i "s/__NUM_SOCKETS__/${socket_count}/g" $RFM_CONFIG_FILES sed -i "s/__NUM_CPUS_PER_CORE__/${threads_per_core}/g" $RFM_CONFIG_FILES sed -i "s/__NUM_CPUS_PER_SOCKET__/${cores_per_socket}/g" $RFM_CONFIG_FILES sed -i "s/__MEM_PER_NODE__/${cgroup_mem_mib}/g" $RFM_CONFIG_FILES +# Make debugging easier by printing the final config file: +echo "Final config file (after replacements):" +cat "${RFM_CONFIG_FILES}" # Workaround for https://github.com/EESSI/software-layer/pull/467#issuecomment-1973341966 export PSM3_DEVICES='self,shm' # this is enough, since we only run single node for now