diff --git a/eessi/testsuite/hooks.py b/eessi/testsuite/hooks.py index 751b3ffb..65c51c87 100644 --- a/eessi/testsuite/hooks.py +++ b/eessi/testsuite/hooks.py @@ -105,6 +105,12 @@ def _assign_num_tasks_per_node(test: rfm.RegressionTest, num_per: int = 1): - num_tasks_per_node = num_per - num_cpus_per_task = test.default_num_cpus_per_node / num_tasks_per_node """ + + # OSU test inherits a default num_tasks_per_node = 1 from hpctestlib. + # There has to be a condition where a non-default value of num_per replaces the original num_tasks_per_node. + if test.num_tasks_per_node and num_per != 1: + if test.num_tasks_per_node != num_per: + test.num_tasks_per_node = num_per # neither num_tasks_per_node nor num_cpus_per_task are set if not test.num_tasks_per_node and not test.num_cpus_per_task: test.num_tasks_per_node = num_per diff --git a/eessi/testsuite/tests/apps/osu.py b/eessi/testsuite/tests/apps/osu.py index 42451700..28e6b2f8 100644 --- a/eessi/testsuite/tests/apps/osu.py +++ b/eessi/testsuite/tests/apps/osu.py @@ -103,22 +103,18 @@ def set_num_tasks(self): """ Setting scales as tags. """ hooks.set_tag_scale(self) - @run_after('init') + @run_after('setup') def set_num_tasks_per_node(self): + """ Setting number of tasks per node and cpus per task in this function. + This function sets num_cpus_per_task for 1 node and 2 node options where + the request is for full nodes.""" if(SCALES.get(self.scale).get('num_nodes') == 1): - self.num_tasks_per_node = 2 + print("test: ", self.num_tasks_per_node) + hooks.assign_tasks_per_compute_unit(self, + COMPUTE_UNIT.get(NODE, + 'node'), 2) else: - self.num_tasks_per_node = 1 - - @run_after('setup') - def set_num_cpus_per_task(self): - """ Since num_tasks_per_node is already set. This function sets - num_cpus_per_task for 1 node and 2 node options where the request is - for full nodes.""" - if(SCALES.get(self.scale).get('num_nodes') >= 1 and - SCALES.get(self.scale).get('node_part', 0) == 1): - hooks.assign_one_task_per_compute_unit(self, - COMPUTE_UNIT.get(CPU, 'cpu')) + hooks.assign_tasks_per_compute_unit(self, COMPUTE_UNIT.get(NODE, 'node')) @run_after('setup') def set_num_gpus_per_node(self):