Skip to content

Commit 792fd3d

Browse files
author
Vasileios Karakasis
authored
Merge pull request #1932 from vkarak/doc/improve-tutorial-configuration
[doc] Make basic configuration example more intuitive w.r.t. to modules systems
2 parents c5b5167 + 7c1a176 commit 792fd3d

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

docs/configure.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ Each system is a different object inside the ``systems`` section.
6868
In our example we define three systems, a Mac laptop, Piz Daint and a generic fallback system:
6969

7070
.. literalinclude:: ../tutorials/config/settings.py
71-
:lines: 11-89
71+
:lines: 11-90
7272

7373
Each system is associated with a set of properties, which in this case are the following:
7474

7575
* ``name``: The name of the system.
7676
This should be an alphanumeric string (dashes ``-`` are allowed) and it will be used to refer to this system in other contexts.
7777
* ``descr``: A detailed description of the system.
7878
* ``hostnames``: This is a list of hostname patterns following the `Python Regular Expression Syntax <https://docs.python.org/3/library/re.html#regular-expression-syntax>`__, which will be used by ReFrame when it tries to automatically select a configuration entry for the current system.
79-
* ``modules_system``: In our example, this is only defined for Piz Daint and refers to the environment modules system that should be used for loading environment modules on this system.
80-
In this case, the classic Tcl implementation of the `environment modules <https://sourceforge.net/projects/modules/files/Modules/modules-3.2.10/>`__.
81-
For a complete list of the supported modules systems, see `here <config_reference.html#.systems[].modules_system>`__.
79+
* ``modules_system``: This refers to the modules management backend which should be used for loading environment modules on this system.
80+
Multiple backends are supported, as well as the special ``nomod`` backend which implements the different modules system operations as no-ops.
81+
For the complete list of the supported modules systems, see `here <config_reference.html#.systems[].modules_system>`__.
8282
* ``partitions``: The list of partitions that are defined for this system.
8383
Each partition is defined as a separate object.
8484
We devote the rest of this section in system partitions, since they are an essential part of ReFrame's configuration.
@@ -90,7 +90,7 @@ The ``login`` partition refers to the login nodes of the system, whereas the ``g
9090
Let's pick the ``gpu`` partition and look into it in more detail:
9191

9292
.. literalinclude:: ../tutorials/config/settings.py
93-
:lines: 38-58
93+
:lines: 39-59
9494

9595
The basic properties of a partition are the following:
9696

@@ -132,7 +132,7 @@ In our example, we define environments for all the basic compilers as well as a
132132
In certain contexts, it is useful to see a ReFrame environment as a wrapper of a programming toolchain (MPI + compiler combination):
133133

134134
.. literalinclude:: ../tutorials/config/settings.py
135-
:lines: 90-148
135+
:lines: 91-149
136136

137137
Each environment is associated with a name.
138138
This name will be used to reference this environment in different contexts, as for example in the ``environs`` property of the system partitions.
@@ -154,7 +154,7 @@ Additionally, it allows for logging performance data from performance tests into
154154
Let's see how logging is defined in our example configuration, which also represents a typical one for logging:
155155

156156
.. literalinclude:: ../tutorials/config/settings.py
157-
:lines: 149-184
157+
:lines: 150-185
158158

159159
Logging is configured under the ``logging`` section of the configuration, which is a list of logger objects.
160160
Unless you want to configure logging differently for different systems, a single logger object is enough.

docs/tutorial_advanced.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ You can then use those resources transparently from within your test.
499499
To achieve this in our case, we first need to define a ``memory`` resource in the configuration:
500500

501501
.. literalinclude:: ../tutorials/config/settings.py
502-
:lines: 30-51,58-74
502+
:lines: 31-52,63-79
503503
:emphasize-lines: 17-22,32-38
504504

505505
Notice that we do not define the resource for all the partitions, but only for those that it makes sense.
@@ -707,7 +707,7 @@ ReFrame can be used also to test applications that run inside a container.
707707
First, we need to enable the container platform support in ReFrame's configuration and, specifically, at the partition configuration level:
708708

709709
.. literalinclude:: ../tutorials/config/settings.py
710-
:lines: 38-62
710+
:lines: 39-63
711711
:emphasize-lines: 15-24
712712

713713
For each partition, users can define a list of container platforms supported using the :js:attr:`container_platforms` `configuration parameter <config_reference.html#.systems[].partitions[].container_platforms>`__.

docs/tutorial_basics.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ Note that you should *not* edit this configuration file in place.
325325
Here is how the new configuration file looks like with the needed additions highlighted:
326326

327327
.. literalinclude:: ../tutorials/config/settings.py
328-
:lines: 10-24,80-101,134-
329-
:emphasize-lines: 3-15,31-42
328+
:lines: 10-25,81-102,135-
329+
:emphasize-lines: 3-16,32-43
330330

331331
Here we define a system named ``catalina`` that has one partition named ``default``.
332332
This partition makes no use of any `workload manager <config_reference.html#.systems[].partitions[].scheduler>`__, but instead launches any jobs locally as OS processes.
@@ -336,8 +336,8 @@ Notice, how you can define the actual commands for invoking the C, C++ and Fortr
336336
As soon as a programming environment defines the different compilers, ReFrame will automatically pick the right compiler based on the source file extension.
337337
In addition to C, C++ and Fortran programs, ReFrame will recognize the ``.cu`` extension as well and will try to invoke the ``nvcc`` compiler for CUDA programs.
338338

339-
Finally, the new system that we defined may be identified by the hostname ``tresa`` (see the :js:attr:`hostnames` configuration parameter).
340-
This will help ReFrame to automatically pick the right configuration when running on it.
339+
Finally, the new system that we defined may be identified by the hostname ``tresa`` (see the :js:attr:`hostnames` configuration parameter) and it will not use any environment modules system (see the :js:attr:`modules_system` configuration parameter).
340+
The :js:attr:`hostnames` attribute will help ReFrame to automatically pick the right configuration when running on it.
341341
Notice, how the ``generic`` system matches any hostname, so that it acts as a fallback system.
342342

343343
.. note::
@@ -827,8 +827,8 @@ Let's extend our configuration file for Piz Daint.
827827

828828

829829
.. literalinclude:: ../tutorials/config/settings.py
830-
:lines: 10-45,62-70,77-
831-
:emphasize-lines: 16-48,70-101,114-120
830+
:lines: 10-46,63-71,78-
831+
:emphasize-lines: 17-49,71-102,115-121
832832

833833

834834
First of all, we need to define a new system and set the list of hostnames that will help ReFrame identify it.

tutorials/config/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'name': 'catalina',
1414
'descr': 'My Mac',
1515
'hostnames': ['tresa'],
16+
'modules_system': 'nomod',
1617
'partitions': [
1718
{
1819
'name': 'default',

0 commit comments

Comments
 (0)