From fb56a4422714e49341080340bc3d66ae5a6ebc6c Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 7 Nov 2025 15:24:55 +0100 Subject: [PATCH] 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 16cd401a7f..1fbd4e3816 100644 --- a/easybuild/easyblocks/l/llvm.py +++ b/easybuild/easyblocks/l/llvm.py @@ -230,6 +230,8 @@ def extra_options(): 'test_suite_ignore_patterns': [None, "List of test to ignore (if the string matches)", CUSTOM], 'test_suite_ignore_timeouts': [False, "Do not treat timedoud tests as failures", 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], @@ -599,9 +601,13 @@ def _configure_final_build(self): # OMPT based tools self._cmakeopts['OPENMP_ENABLE_OMPT_TOOLS'] = ompt_value - # 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']: