Skip to content

Commit eb9f403

Browse files
authored
Merge pull request #772 from AaltoSciComp/module-updates
Update module documentation
2 parents 42107cf + 2b8b7fa commit eb9f403

File tree

5 files changed

+63
-57
lines changed

5 files changed

+63
-57
lines changed

triton/quickstart/jobs.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ So, let us go through this script:
6969
7070
Most programming languages and tools have their own modules that need to be loaded before they can be run. You can get a list of available
7171
modules by running ``module spider``. If you need a specific version of a module, you can check the available versions by running ``module spider MODULENAME``
72-
(e.g. ``module spider r`` for ``R``). To load a specific version you have to specify this version during the load command (e.g. ``module load matlab/r2023b``
72+
(e.g. ``module spider r`` for ``R``). Several modules also require loading a specific software stack module before they can be loaded.
73+
You can do ``module spider MODULENAME/VERSION`` to see what modules need to be loaded beforehand and what software stacks contain that specific version.
74+
To load a specific version you have to specify this version during the load command (e.g. ``module load matlab/r2023b``
7375
for the 2023b release of MATLAB). For further details please have a look at the :ref:`instructions for the specific application <application-list>`
7476

7577
There are plenty more parameters that you can set for the slurm scheduler as well (for a detailed list can be found `here <https://slurm.schedmd.com/pdfs/summary.pdf>`__),

triton/ref/modules.rst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
:delim: |
33
:header-rows: 1
44

5-
Command | Description
6-
``module load`` *NAME* | load module
7-
``module avail`` | list all modules
8-
``module spider`` *PATTERN* | search modules
9-
``module spider`` *NAME/ver* | show prerequisite modules to this one
10-
``module list`` | list currently loaded modules
11-
``module show`` *NAME* | details on a module
12-
``module help`` *NAME* | details on a module
13-
``module unload`` *NAME* | unload a module
14-
``module save`` *ALIAS* | save module collection to this alias (saved in ``~/.lmod.d/``)
15-
``module savelist`` | list all saved collections
16-
``module describe`` *ALIAS* | details on a collection
17-
``module restore`` *ALIAS* | load saved module collection (faster than loading individually)
18-
``module purge`` | unload all loaded modules (faster than unloading individually)
5+
Command / concept | Description
6+
"module" | A software that can be made available.
7+
"software stack" | Includes the compliers (etc) needed for other modules. Must be loaded before other modules.
8+
``module load`` *NAME* | Load module, can combine multiple names.
9+
``module load`` triton/*NAME* | Load software stack module. Makes other compiled software available. Generally, run ``module spider`` to first to see what you need.
10+
``module avail`` | List all modules available with current software stack.
11+
``module spider`` *PATTERN* | Search modules
12+
``module spider`` *NAME/ver* | Show prerequisite modules (the softare stack) to this one
13+
``module list`` | List currently loaded modules
14+
``module show`` *NAME* | Details on a module
15+
``module help`` *NAME* | Details on a module
16+
``module unload`` *NAME* | Unload a module
17+
``module save`` *ALIAS* | Save module collection to this alias (saved in ``~/.lmod.d/``)
18+
``module savelist`` | List all saved collections
19+
``module describe`` *ALIAS* | Details on a collection
20+
``module restore`` *ALIAS* | Load saved module collection (faster than loading individually)
21+
``module purge`` | Unload all loaded modules (faster than unloading individually)

triton/tut/gpu.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ a newer compiler:
160160

161161
.. code-block:: bash
162162
163-
module load gcc/12.3.0 cuda/12.2.1
163+
module load triton/2024.1-gcc gcc/12.3.0 cuda/12.2.1
164164
165165
Now we should have a compiler and a CUDA toolkit loaded. After this
166166
we can compile the code with:
@@ -191,7 +191,7 @@ Using a slurm script setting the requirements and loading the correct modules be
191191
#SBATCH --output=pi-gpu.out
192192
#SBATCH --gpus=1
193193
194-
module load cuda/12.2.1
194+
module load triton/2024.1-gcc cuda/12.2.1
195195
./pi-gpu 1000000
196196
197197
.. note::

triton/tut/modules.rst

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ software by default for every user.
4949
A module lets you adjust what software is available,
5050
and makes it easy to switch between different versions.
5151

52-
As an example, let's inspect the ``triton_base_python`` module with ``module
52+
As an example, let's inspect the ``scicomp-python-env`` module with ``module
5353
show scicomp-python-env``:
5454

5555
.. highlight:: console
@@ -173,46 +173,44 @@ Hierarchical modules
173173
--------------------
174174

175175
Hierarchical modules means that you have to load one module before you
176-
can load another. This is usually a compiler:
176+
can load another. In the case of Triton, most compiled software will
177+
require loading a relevant software stack module. Another common
178+
hierarchy is for MPI software.
177179

178-
**Warning: This example is not yet updated for new-Triton and won't work
179-
anymore. The concept still applies.**
180-
181-
For example, let's load a newer version of R:
180+
For example, let's load a newer version of CMake:
182181

183182
.. code-block:: console
184183
:emphasize-lines: 3-4
185184
186-
$ module load r/4.2.2
185+
$ module load cmake/3.27.7
187186
Lmod has detected the following error: These module(s) or
188-
extension(s) exist but cannot be loaded as requested: "r/4.2.2"
189-
Try: "module spider r/4.2.2" to see how to load the module(s).
187+
extension(s) exist but cannot be loaded as requested: "cmake/3.27.7"
188+
Try: "module spider cmake/3.27.7" to see how to load the module(s).
190189
191190
Lmod says that the modules exist but can't be loaded, but gives a hint
192191
for what to do next. Let's do that:
193192

194193
.. code-block:: console
195194
:emphasize-lines: 7-9
196195
197-
$ module spider r/4.2.2
196+
$ module spider cmake/3.27.7
198197
199198
----------------------------------------------------------------------------
200-
r: r/4.2.2
199+
cmake: cmake/3.27.7
201200
----------------------------------------------------------------------------
202201
203-
You will need to load all module(s) on any one of the lines below before the "r/4.2.2" module is available to load.
202+
You will need to load all module(s) on any one of the lines below before the "cmake/3.27.7" module is available to load.
204203
205-
gcc/11.3.0
204+
triton/2024.1-gcc
206205
207206
Help:
208207
...
209208
210209
So now we can load it (we can do it in one line)::
211210

212-
$ module load gcc/11.3.0 r/4.2.2
213-
$ R --version
214-
R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"
215-
211+
$ module load triton/2024.1-gcc cmake/3.27.7
212+
$ cmake --version
213+
cmake version 3.27.7
216214

217215

218216

@@ -242,9 +240,7 @@ dependencies. This can result in long loading times or be annoying to
242240
do each time you log in to the system. However, there is a solution:
243241
``module save COLLECTION_NAME`` and ``module restore COLLECTION_NAME``
244242

245-
Let's see how to do this in an example. **Warning: This example is not
246-
yet updated for new-Triton and won't work anymore. The concept still
247-
applies.**
243+
Let's see how to do this in an example.
248244

249245
Let's say that for compiling / running your program you need:
250246

@@ -256,8 +252,8 @@ Let's say that for compiling / running your program you need:
256252

257253
You could run this each time you want to compile/run your code::
258254

259-
$ module load gcc/9.2.0 cmake/3.15.3 openmpi/3.1.4 fftw/3.3.8-openmpi openblas/0.3.7
260-
$ module list # 15 modules
255+
$ module load triton/2024.1-gcc gcc/12.3.0 cmake/3.27.7 openmpi/4.1.6 fftw/3.3.10 openblas/0.3.24
256+
$ module list # 32 modules
261257

262258
Let's say this environment works for you. Now you can save it with
263259
``module save MY-ENV-NAME``. Then ``module purge`` to unload
@@ -266,7 +262,7 @@ everything. Now, do ``module restore MY-ENV-NAME``::
266262
$ module save my-env
267263
$ module purge
268264
$ module restore my-env
269-
$ module list # same 15 modules
265+
$ module list # same 32 modules
270266

271267
Generally, it is a good idea to save your modules as a collection to
272268
have your desired modules all set up each time you want to
@@ -402,37 +398,42 @@ to check your local documentation for what the equivalents are.
402398
you can see that ``cmake`` loads several other modules when it
403399
is loaded. Some of these models also load their own depedencies.
404400

405-
.. exercise:: Hierarchical modules
401+
.. exercise:: Modules-4: Modules with multiple hierarchies
406402

407-
How can you load the module ``quantum-espresso/7.2``::
403+
How can you load the module ``fftw/3.3.10``::
408404

409-
$ module load quantum-espresso/7.2
405+
$ module load fftw/3.3.10
410406
Lmod has detected the following error: These module(s) or
411-
extension(s) exist but cannot be loaded as requested: "quantum-espresso/7.2"
412-
Try: "module spider quantum-espresso/7.2" to see how to load the module(s).
407+
extension(s) exist but cannot be loaded as requested: "fftw/3.3.10"
408+
Try: "module spider fftw/3.3.10" to see how to load the module(s).
413409

414410

415411
.. solution::
416412

417413
This is a double-hierarchical module, that is built using two
418-
different toolchains, so you have a choice to make when loading::
414+
different toolchains. In addition to requiring the relevant software
415+
stack module, you also have a choice to make when loading::
419416

420-
$ module spider quantum-espresso/7.2
417+
$ module spider fftw/3.3.10
421418
...
422419
You will need to load all module(s) on any one of the lines
423420
below before the "openfoam-org/11" module is available to load.
424421

425-
openmpi/4.1.6
426-
scibuilder-spack-dev/2024-01 openmpi/4.1.6
422+
triton/2024.1-gcc
423+
triton/2024.1-gcc openmpi/4.1.6
424+
425+
Now let us load the version compiled with openmpi support as an example::
427426

428-
So here we go, loaded and we use ``which`` to verify one of the
429-
programs can be found::
427+
$ module load triton/2024.1-gcc openmpi/4.1.6 fftw/3.3.10
430428

431-
$ module load openmpi/4.1.6 quantum-espresso/7.2
432-
$ which pw.x
433-
/appl/scibuilder-spack/aalto-rhel9-dev/2024-01/software/linux-rhel9-haswell/gcc-12.3.0/quantum-espresso-7.2-kmqslxn/bin/pw.x
429+
Then check what happens if we unload the openmpi module::
434430

431+
$ module unload openmpi/4.1.6
432+
Due to MODULEPATH changes, the following have been reloaded:
433+
1) fftw/3.3.10
435434

435+
Lmod automatically changed the version of fftw to one without mpi support,
436+
since we no longer have any mpi libraries loaded.
436437

437438
.. exercise:: Modules-5: Modules and dependencies
438439

triton/tut/parallel-mpi.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ can utilize multiple MPI tasks for calculating the trials.
120120
First off, we need to compile the program with a suitable OpenMPI version. Let's use the
121121
recommended version ``openmpi/4.1.6``::
122122

123-
$ module load openmpi/4.1.6
123+
$ module load triton/2024.1-gcc openmpi/4.1.6
124124

125125
$ mpicc -o pi-mpi slurm/pi-mpi.c
126126

@@ -143,7 +143,7 @@ Using a slurm script setting the requirements and loading the correct modules be
143143
#SBATCH --nodes=1
144144
#SBATCH --ntasks=2
145145
146-
module load openmpi/4.1.6
146+
module load triton/2024.1-gcc openmpi/4.1.6
147147
148148
srun ./pi-mpi 1000000
149149
@@ -201,7 +201,7 @@ following script:
201201
#SBATCH --ntasks-per-node=24 # 24 processes as that is the number in the machine
202202
#SBATCH --constraint=hsw # set constraint for processor architecture
203203
204-
module load openmpi/4.1.6 # NOTE: should be the same as you used to compile the code
204+
module load triton/2024.1-gcc openmpi/4.1.6 # NOTE: should be the same as you used to compile the code
205205
srun ./pi-mpi 1000000
206206
207207
Monitoring performance

0 commit comments

Comments
 (0)