You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced.rst
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -397,3 +397,49 @@ Another way, which is quite useful if you want to generate lots of different tes
397
397
398
398
Combining parameterized tests and test class hierarchies can offer you a very flexible way for generating multiple related tests at once keeping at the same time the maintenance cost low.
399
399
We use this technique extensively in our tests.
400
+
401
+
402
+
Flexible Regression Tests
403
+
-------------------------
404
+
405
+
.. versionadded:: 2.15
406
+
407
+
ReFrame can automatically set the number of tasks of a particular test, if its :attr:`num_tasks <reframe.core.pipeline.RegressionTest.num_tasks>` attribute is set to ``0``.
408
+
In ReFrame's terminology, such tests are called `flexible`.
409
+
By default, ReFrame will spawn such a test on all the idle nodes of the current system partition, but this behavior can be adjusted from the command-line.
410
+
Flexible tests are very useful for diagnostics tests, e.g., tests for checking the health of a whole set nodes.
411
+
In this example, we demonstrate this feature through a simple test that runs ``hostname``.
412
+
The test will verify that all the nodes print the expected host name:
Notice, however, that the sanity check does not use :attr:`num_tasks` for verification, but rather a different, custom attribute, the ``num_tasks_assigned``.
430
+
This happens for two reasons:
431
+
432
+
a. At the time the sanity check expression is created, :attr:`num_tasks` is ``0``.
433
+
So the actual number of tasks assigned must be a deferred expression as well.
434
+
b. When ReFrame will determine and set the number of tasks of the test, it will not set the :attr:`num_tasks` attribute of the :class:`RegressionTest`.
435
+
It will only set the corresponding attribute of the associated job instance.
436
+
437
+
Here is how the new deferred attribute is defined:
* ``--strict``: Force strict performance checking. Some tests may set their :attr:`strict_check <reframe.core.pipeline.RegressionTest.strick_check>` attribute to :class:`False` (see `"Reference Guide" <reference.html>`__) in order to just let their performance recorded but not yield an error.
468
+
* ``--strict``: Force strict performance checking. Some tests may set their :attr:`strict_check <reframe.core.pipeline.RegressionTest.strick_check>` attribute to :class:`False` (see `"Reference Guide" <running.html#controlling-the-execution-of-regression-tests>`__) in order to just let their performance recorded but not yield an error.
468
469
This option overrides this behavior and forces all tests to be strict.
469
470
* ``--skip-system-check``: Skips the system check and run the selected tests even if they do not support the current system.
470
471
This option is sometimes useful when you need to quickly verify if a regression test supports a new system.
@@ -998,3 +999,34 @@ If you now try to run a test that loads the module `cudatoolkit`, the following
ReFrame can automatically set the number of tasks of a particular test, if its :attr:`num_tasks <reframe.core.pipeline.RegressionTest.num_tasks>` attribute is set to ``0``.
1009
+
By default, ReFrame will spawn such a test on all the idle nodes of the current system partition.
1010
+
This behavior can be adjusted using the ``--flex-alloc-tasks`` command line option.
1011
+
This option accepts three values:
1012
+
1013
+
1. ``idle``: (default) In this case, ReFrame will set the number of tasks to the number of idle nodes of the current logical partition multiplied by the :attr:`num_tasks_per_node <reframe.core.pipeline.RegressionTest.num_tasks_per_node>` attribute of the particular test.
1014
+
2. ``all``: In this case, ReFrame will set the number of tasks to the number of all the nodes of the current logical partition multiplied by the :attr:`num_tasks_per_node <reframe.core.pipeline.RegressionTest.num_tasks_per_node>` attribute of the particular test.
1015
+
1016
+
3. Any positive integer: In this case, ReFrame will set the number of tasks to the given value.
1017
+
1018
+
The flexible allocation of number of tasks takes into account any additional logical constraint imposed by the command line options affecting the job allocation, such as ``--partition``, ``--reservation``, ``--nodelist``, ``--exclude-nodes`` and ``--job-option`` (if the scheduler option passed to the latter imposes a restriction).
1019
+
Notice that ReFrame will issue an error if the resulting number of nodes is zero.
1020
+
1021
+
For example, using the following options would run a flexible test on all the nodes of reservation ``foo`` except the nodes ``n0[1-5]``:
Flexible task allocation is supported only for the Slurm scheduler backend.
1030
+
1031
+
.. warning::
1032
+
Test cases resulting from flexible ReFrame tests may not be run using the asynchronous execution policy, because the nodes satisfying the required criteria will be allocated for the first test case, causing all subsequent ones to fail.
0 commit comments