Mix of serial and parallel tests
See original GitHub issueHi, I would like to run some test in parallel meanwhile other in serial. The real use is to run compute tests in parallel with storage benchmark of shared target (you do not want to run multiple differrent IOR at the same time on the same target).
Consider the following example:
@rfm.simple_test
class ARunTest(rfm.RunOnlyRegressionTest):
descr = "A Run"
valid_systems = ["hpc:hpc"]
valid_prog_environs = ["*"]
param = parameter(["AA", "AB"])
# max_jobs = 1
def __init__(self):
self.executable = f"date; echo {self.param}"
# @run_before("run")
# def set_exec(self):
# self.current_partition.max_jobs = 1
@sanity_function
def assert_passed(self):
return True
@rfm.simple_test
class BRunTest(rfm.RunOnlyRegressionTest):
descr = "B Run"
valid_systems = ["hpc:hpc"]
valid_prog_environs = ["*"]
param = parameter(["BA", "BB"])
def __init__(self):
self.executable = f"date; echo {self.param}"
@sanity_function
def assert_passed(self):
return True
The ARunTest
should run in serial: ARunTest_AA
first and on completion start ARunTest_AB
.
While BRunTest
should run in parallel: BRunTest_BA
concurrent to ARunTest_BB
.
Using the default settings ARunTest_AA
, ARunTest_AB
, BRunTest_BA
, BRunTest_BB
run in parallel.
Instead using the option --exec-policy=serial
it will run ARunTest_AA
then ARunTest_AB
then BRunTest_BA
then BRunTest_BB
.
The trick would be to set a max_jobs = 1
variable for the class ARunTest
but it is simply skipped.
Or:
@run_before("run")
def set_exec(self):
self.current_partition.max_jobs = 1
but I get: can't set attribute self.current_partition.max_jobs = 1
It there a workaround for this?
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)
Top GitHub Comments
Thanks for the information. I will have a play and report back.
Hi @yellowhat ! Glad that it worked. We will probably add the corresponding tutorial once we address all the issues mentioned above. This case access protected variables (
_rfm_param_space
) and it would get a lot more complicated if one has 2 or more parameters, so this is by all means a workaround and I doubt is general enough for the general audience.