summaryrefslogtreecommitdiff
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-11-26 14:12:25 +0000
committerKitware Robot <kwrobot@kitware.com>2019-11-26 09:12:34 -0500
commit3d5227e6b654b7c49c3d0cbc633d832104a0a7fe (patch)
tree255d1647766c1aca1318ee6c953190e7345c8fd8 /Help
parenteafce6c2562a76ef33c2258d2fef04aae2b4e6e9 (diff)
parenta033bafbe01fcb4654f075955e0b3de7be81b0f7 (diff)
downloadcmake-3d5227e6b654b7c49c3d0cbc633d832104a0a7fe.tar.gz
Merge topic 'ctest-resource-fixes'
a033bafbe0 Help: Clarify how tests are run if no resource spec file is specified a64ba0235f CTest: Clarify that resource requirements can be split f9f294f5fa CTest: Add version field to resource spec file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4080
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/ctest.1.rst26
-rw-r--r--Help/prop_test/RESOURCE_GROUPS.rst16
2 files changed, 42 insertions, 0 deletions
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 2a6cb48b2c..17bddb6789 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -1348,6 +1348,23 @@ the :ref:`environment variables <ctest-resource-environment-variables>` to
determine which resources have been allocated to each group. For example,
each group may correspond to a process the test will spawn when executed.
+Note that even if a test specifies a ``RESOURCE_GROUPS`` property, it is still
+possible for that to test to run without any resource allocation (and without
+the corresponding
+:ref:`environment variables <ctest-resource-environment-variables>`)
+if the user does not pass a resource specification file. Passing this file,
+either through the ``--resource-spec-file`` command-line argument or the
+``RESOURCE_SPEC_FILE`` argument to :command:`ctest_test`, is what activates the
+resource allocation feature. Tests should check the
+``CTEST_RESOURCE_GROUP_COUNT`` environment variable to find out whether or not
+resource allocation is activated. This variable will always (and only) be
+defined if resource allocation is activated. If resource allocation is not
+activated, then the ``CTEST_RESOURCE_GROUP_COUNT`` variable will not exist,
+even if it exists for the parent ``ctest`` process. If a test absolutely must
+have resource allocation, then it can return a failing exit code or use the
+:prop_test:`SKIP_RETURN_CODE` or :prop_test:`SKIP_REGULAR_EXPRESSION`
+properties to indicate a skipped test.
+
.. _`ctest-resource-specification-file`:
Resource Specification File
@@ -1362,6 +1379,10 @@ the following resource specification file:
.. code-block:: json
{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
"local": [
{
"gpus": [
@@ -1393,6 +1414,11 @@ the following resource specification file:
The members are:
+``version``
+ An object containing a ``major`` integer field and a ``minor`` integer field.
+ Currently, the only supported version is major ``1``, minor ``0``. Any other
+ value is an error.
+
``local``
A JSON array of resource sets present on the system. Currently, this array
is restricted to being of size 1.
diff --git a/Help/prop_test/RESOURCE_GROUPS.rst b/Help/prop_test/RESOURCE_GROUPS.rst
index 436451cc9b..63c56ce559 100644
--- a/Help/prop_test/RESOURCE_GROUPS.rst
+++ b/Help/prop_test/RESOURCE_GROUPS.rst
@@ -38,6 +38,22 @@ This single group requires 4 slots from a single GPU and 2 slots from a
single cryptography chip. In total, 3 resource groups are specified for this
test, each with its own unique requirements.
+Note that the number of slots following the resource type specifies slots from
+a *single* instance of the resource. If the resource group can tolerate
+receiving slots from different instances of the same resource, it can indicate
+this by splitting the specification into multiple requirements of one slot. For
+example:
+
+.. code-block:: cmake
+
+ add_test(NAME MyTest COMMAND MyExe)
+ set_property(TEST MyTest PROPERTY RESOURCE_GROUPS
+ "gpus:1,gpus:1,gpus:1,gpus:1")
+
+In this case, the single resource group indicates that it needs four GPU slots,
+all of which may come from separate GPUs (though they don't have to; CTest may
+still assign slots from the same GPU.)
+
When CTest sets the :ref:`environment variables
<ctest-resource-environment-variables>` for a test, it assigns a group number
based on the group description, starting at 0 on the left and the number of