From 8a3ad51c3b2d579dd1daa9418090f33f2d488061 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Tue, 5 May 2026 19:53:05 +0200 Subject: [PATCH 1/4] update docstring for assign_tasks_per_compute_unit and add check --- eessi/testsuite/hooks.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/eessi/testsuite/hooks.py b/eessi/testsuite/hooks.py index 919a63c7..6bf86224 100644 --- a/eessi/testsuite/hooks.py +++ b/eessi/testsuite/hooks.py @@ -93,15 +93,22 @@ def assign_tasks_per_compute_unit(test: rfm.RegressionTest): Arguments: - test: the ReFrame test to which this hook should apply + + The following test attributes must be set: - compute_unit: a device as listed in eessi.testsuite.constants.COMPUTE_UNITS + - num_tasks_per_compute_unit: the number of tasks per compute unit Examples: On a single node with 2 sockets, 64 cores and 128 hyperthreads: - - assign_tasks_per_compute_unit(test, COMPUTE_UNITS.HWTHREAD) will launch 128 tasks with 1 thread per task - - assign_tasks_per_compute_unit(test, COMPUTE_UNITS.CPU) will launch 64 tasks with 2 threads per task - - assign_tasks_per_compute_unit(test, COMPUTE_UNITS.CPU_SOCKET) will launch 2 tasks with 64 threads per task + - test.compute_unit = COMPUTE_UNITS.HWTHREAD will launch 128 tasks with 1 thread per task + - test.compute_unit = COMPUTE_UNITS.CPU will launch 64 tasks with 2 threads per task + - test.compute_unit = COMPUTE_UNITS.CPU_SOCKET will launch 2 tasks with 64 threads per task """ + for attribute in ['compute_unit', 'num_tasks_per_compute_unit']: + if not hasattr(test, attribute): + raise NotImplementedError(f'test attribute {attribute} must be defined') + compute_unit = test.compute_unit num_per = test.num_tasks_per_compute_unit log(f'assign_tasks_per_compute_unit with compute_unit: {compute_unit} and num_per: {num_per}') From 387cd9c67d93a2d9f98299aa48c0ae2bc675c97a Mon Sep 17 00:00:00 2001 From: Sam Moors Date: Wed, 6 May 2026 13:04:04 +0200 Subject: [PATCH 2/4] Update eessi/testsuite/hooks.py Co-authored-by: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> --- eessi/testsuite/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eessi/testsuite/hooks.py b/eessi/testsuite/hooks.py index 6bf86224..8d59b89a 100644 --- a/eessi/testsuite/hooks.py +++ b/eessi/testsuite/hooks.py @@ -107,7 +107,7 @@ def assign_tasks_per_compute_unit(test: rfm.RegressionTest): """ for attribute in ['compute_unit', 'num_tasks_per_compute_unit']: if not hasattr(test, attribute): - raise NotImplementedError(f'test attribute {attribute} must be defined') + raise NotImplementedError(f'test attribute {attribute} must be defined before calling assign_tasks_per_compute_unit') compute_unit = test.compute_unit num_per = test.num_tasks_per_compute_unit From c7e9a90e85c34528b7c4d52b3e6a32f68c112758 Mon Sep 17 00:00:00 2001 From: Sam Moors Date: Wed, 6 May 2026 13:06:22 +0200 Subject: [PATCH 3/4] fix line too long --- eessi/testsuite/hooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eessi/testsuite/hooks.py b/eessi/testsuite/hooks.py index 8d59b89a..673a1916 100644 --- a/eessi/testsuite/hooks.py +++ b/eessi/testsuite/hooks.py @@ -107,7 +107,8 @@ def assign_tasks_per_compute_unit(test: rfm.RegressionTest): """ for attribute in ['compute_unit', 'num_tasks_per_compute_unit']: if not hasattr(test, attribute): - raise NotImplementedError(f'test attribute {attribute} must be defined before calling assign_tasks_per_compute_unit') + raise NotImplementedError( + f'test attribute {attribute} must be defined before calling assign_tasks_per_compute_unit') compute_unit = test.compute_unit num_per = test.num_tasks_per_compute_unit From abcf4e5e0b23d64903be9c72a9fb09ebe0006049 Mon Sep 17 00:00:00 2001 From: Sam Moors Date: Wed, 6 May 2026 13:09:02 +0200 Subject: [PATCH 4/4] fix --- eessi/testsuite/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eessi/testsuite/hooks.py b/eessi/testsuite/hooks.py index 673a1916..dbededd0 100644 --- a/eessi/testsuite/hooks.py +++ b/eessi/testsuite/hooks.py @@ -108,7 +108,7 @@ def assign_tasks_per_compute_unit(test: rfm.RegressionTest): for attribute in ['compute_unit', 'num_tasks_per_compute_unit']: if not hasattr(test, attribute): raise NotImplementedError( - f'test attribute {attribute} must be defined before calling assign_tasks_per_compute_unit') + f'test attribute {attribute} must be defined before calling assign_tasks_per_compute_unit') compute_unit = test.compute_unit num_per = test.num_tasks_per_compute_unit