From dfe2444d24de952a0bb03a4f2c64ecc72bd4c387 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 7 Nov 2025 15:24:55 +0100 Subject: [PATCH 1/2] Add `test_suite_max_parallel` option to LLVM Allow to limit number of parallel test tasks. --- easybuild/easyblocks/l/llvm.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/l/llvm.py b/easybuild/easyblocks/l/llvm.py index 1ad59bf53a4..55e62d06b4c 100644 --- a/easybuild/easyblocks/l/llvm.py +++ b/easybuild/easyblocks/l/llvm.py @@ -232,6 +232,8 @@ def extra_options(): 'test_suite_ignore_timeouts': [False, "Do not treat timedoud tests as failures", CUSTOM], 'test_suite_include_benchmarks': [False, "Include benchmarks in the LLVM tests (default False)", CUSTOM], 'test_suite_max_failed': [0, "Maximum number of failing tests (does not count allowed failures)", CUSTOM], + 'test_suite_max_parallel': [None, "Maximum number LIT tasks to use for tests. " + "Limitted by the global parallel setting.", CUSTOM], 'test_suite_timeout_single': [None, "Timeout for each individual test in the test suite", CUSTOM], 'test_suite_timeout_total': [None, "Timeout for total running time of the testsuite", CUSTOM], 'use_pic': [True, "Build with Position Independent Code (PIC)", CUSTOM], @@ -644,9 +646,13 @@ def _configure_final_build(self): self._cmakeopts[cmake_flag] = include_benchmarks self.runtimes_cmake_args[cmake_flag] = include_benchmarks - # Make sure tests are not running with more than 'parallel' tasks + # Set parallel LIT tasks. Limit by set max-parallelism and in absence of that + # use --mpi-tests to determine if parallelism is desired. parallel = self.cfg.parallel - if not build_option('mpi_tests'): + max_parallel = self.cfg['test_suite_max_parallel'] + if max_parallel: + parallel = min(max_parallel, parallel) + elif not build_option('mpi_tests'): parallel = 1 lit_args = [f'-j {parallel}'] if self.cfg['debug_tests']: From 21f8093a5a429833b80564e7776ccca17af1c12f Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 3 Dec 2025 09:59:45 +0100 Subject: [PATCH 2/2] Default to 1 LIT task The parallel build of tests is important, running tests itself in parallel doesn't help much so limit to 1 by default. --- easybuild/easyblocks/l/llvm.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/easybuild/easyblocks/l/llvm.py b/easybuild/easyblocks/l/llvm.py index 55e62d06b4c..aa99b4735a4 100644 --- a/easybuild/easyblocks/l/llvm.py +++ b/easybuild/easyblocks/l/llvm.py @@ -232,7 +232,7 @@ def extra_options(): 'test_suite_ignore_timeouts': [False, "Do not treat timedoud tests as failures", CUSTOM], 'test_suite_include_benchmarks': [False, "Include benchmarks in the LLVM tests (default False)", CUSTOM], 'test_suite_max_failed': [0, "Maximum number of failing tests (does not count allowed failures)", CUSTOM], - 'test_suite_max_parallel': [None, "Maximum number LIT tasks to use for tests. " + 'test_suite_max_parallel': [1, "Maximum number LIT tasks to use for tests. " "Limitted by the global parallel setting.", CUSTOM], 'test_suite_timeout_single': [None, "Timeout for each individual test in the test suite", CUSTOM], 'test_suite_timeout_total': [None, "Timeout for total running time of the testsuite", CUSTOM], @@ -648,12 +648,7 @@ def _configure_final_build(self): # Set parallel LIT tasks. Limit by set max-parallelism and in absence of that # use --mpi-tests to determine if parallelism is desired. - parallel = self.cfg.parallel - max_parallel = self.cfg['test_suite_max_parallel'] - if max_parallel: - parallel = min(max_parallel, parallel) - elif not build_option('mpi_tests'): - parallel = 1 + parallel = min(self.cfg.parallel, self.cfg['test_suite_max_parallel']) lit_args = [f'-j {parallel}'] if self.cfg['debug_tests']: lit_args += ['-v']