Modules: Difference between revisions

From Grid5000
Jump to navigation Jump to search
Line 78: Line 78:


The full documentation of module command is available at: http://modules.sourceforge.net/
The full documentation of module command is available at: http://modules.sourceforge.net/
== Using modules in jobs ==
The ''module'' command is not a real executable, but a shell function.
If it is not available from your shell (it might be the case if you use zsh), ensure that <code>/etc/profile.d/lmod.sh</code> is sourced.
In addition, ''module'' must be executed in an actual shell to work: a simple <code class="command">oarsub "module load gcc"</code> will fail, you must use either:
{{Term|location=fnancy|cmd=<code class="command">oarsub</code> <code class="command">'bash -l -c "module load gcc; gcc --version"'</code>}}
or alternatively:
{{Term|location=fnancy|cmd=<code class="command">oarsub</code> <code class="command">". /etc/profile; module load gcc; gcc --version"</code>}}


== Modules that require connection to license server ==
== Modules that require connection to license server ==

Revision as of 16:31, 23 June 2023

Note.png Note

This page is actively maintained by the Grid'5000 team. If you encounter problems, please report them (see the Support page). Additionally, as it is a wiki page, you are free to make minor corrections yourself if needed. If you would like to suggest a more fundamental change, please contact the Grid'5000 team.

Grid'5000 provides a set of software (mainly scientific-related) using Lmod, thanks to the module command line tool.

They are available from Grid5000 frontends or cluster's nodes (only on debianXX-big and debianXX-nfs environment if deployment is used).

The modules command

General usage

The module system is designed to load software and make it available by modifying environment (such as your PATH variable).

To get started, list available software using:

 $ module av
 ------------------------------------------------------------ /grid5000/spack/v1/share/spack/modules/linux-debian11-x86_64_v2 ------------------------------------------------------------
  anaconda3/2022.05_gcc-10.4.0                         intel-oneapi-ipp/2021.6.0_gcc-10.4.0                 pmix/4.1.2_gcc-10.4.0
  apptainer/1.0.2_gcc-10.4.0                           intel-oneapi-ipp/2021.7.0_gcc-10.4.0          (D)    py-numpy/1.23.3_gcc-10.4.0-intelmpi-python-3.9.13
  cmake/3.23.3_gcc-10.4.0                              intel-oneapi-mkl/2022.1.0_gcc-10.4.0-intelmpi        py-pyopencl/2020.2.2_gcc-10.4.0-intelmpi-python-3.9.13
  comgr/5.2.0_gcc-10.4.0                               intel-oneapi-mkl/2022.1.0_gcc-10.4.0-openmpi         python/3.9.13_gcc-10.4.0
  cube/4.6_gcc-10.4.0                                  intel-oneapi-mkl/2023.0.0_gcc-10.4.0-intelmpi (D)    rdma-core/41.0_gcc-10.4.0
  cuda/11.4.0_gcc-10.4.0                               intel-oneapi-mpi/2021.6.0_gcc-10.4.0                 rocblas/5.2.0_gcc-10.4.0
  cuda/11.6.2_gcc-10.4.0                               intel-oneapi-mpi/2021.8.0_gcc-10.4.0          (D)    rocm-cmake/5.2.0_gcc-10.4.0
  cuda/11.7.1_gcc-10.4.0                        (D)    intel-oneapi-tbb/2021.8.0_gcc-10.4.0                 rocm-opencl/5.2.0_gcc-10.4.0
  cudnn/8.2.4.15-11.4_gcc-10.4.0                       intel-oneapi-vtune/2022.3.0_gcc-10.4.0               rocm-openmp-extras/5.2.0_gcc-10.4.0
  cudnn/8.4.0.27-11.6_gcc-10.4.0                (D)    intel-oneapi-vtune/2023.0.0_gcc-10.4.0        (D)    rocm-smi-lib/5.2.3_gcc-10.4.0
  dbus/1.13.6_gcc-10.4.0                               julia/1.8.2_gcc-10.4.0                               rocminfo/5.2.0_gcc-10.4.0
  gcc/10.4.0_gcc-10.4.0                                libfabric/1.15.1_gcc-10.4.0                          rocprofiler-dev/5.2.0_gcc-10.4.0
  gcc/12.2.0_gcc-10.4.0                         (D)    llvm/13.0.1_gcc-10.4.0                               rocsolver/5.2.0_gcc-10.4.0
  glpk/4.65_gcc-10.4.0                                 llvm-amdgpu/5.2.0_gcc-10.4.0                         roctracer-dev-api/5.2.0_gcc-10.4.0
  go/1.18_gcc-10.4.0                                   metis/5.1.0_gcc-10.4.0                               rust/1.65.0_gcc-10.4.0
  hip/5.2.0_gcc-10.4.0                                 miniconda3/4.10.3_gcc-10.4.0                         scalasca/2.6_gcc-10.4.0-openmpi
  hipblas/5.2.0_gcc-10.4.0                             miniconda3/22.11.1_gcc-10.4.0                 (D)    scorep/7.1_gcc-10.4.0-openmpi
  hsa-rocr-dev/5.2.0_gcc-10.4.0                        mpich/4.0.2_gcc-10.4.0-cuda                          scotch/7.0.1_gcc-10.4.0-intelmpi
  hsakmt-roct/5.2.0_gcc-10.4.0                         mpich/4.0.2_gcc-10.4.0                        (D)    singularity/3.8.5_gcc-10.4.0
  intel-oneapi-advisor/2022.1.0_gcc-10.4.0             mumps/5.4.1_gcc-10.4.0-intelmpi                      singularity/3.8.7_gcc-10.4.0                           (D)
  intel-oneapi-advisor/2023.0.0_gcc-10.4.0      (D)    mvapich2/2.3.7_gcc-10.4.0                            starpu/1.3.9_gcc-10.4.0
  intel-oneapi-ccl/2021.6.0_gcc-10.4.0-intelmpi        netlib-lapack/3.10.1_gcc-10.4.0                      ucx/1.13.1_gcc-10.4.0-compat
  intel-oneapi-ccl/2021.8.0_gcc-10.4.0-intelmpi (D)    netlib-scalapack/2.2.0_gcc-10.4.0-openmpi            ucx/1.13.1_gcc-10.4.0                                  (D)
  intel-oneapi-compilers/2022.1.0_gcc-10.4.0           opa-psm2/11.2.230_gcc-10.4.0                         valgrind/3.19.0_gcc-10.4.0-intelmpi
  intel-oneapi-compilers/2023.0.0_gcc-10.4.0    (D)    openblas/0.3.20_gcc-10.4.0                           valgrind/3.19.0_gcc-10.4.0-openmpi                     (D)
  intel-oneapi-dpl/2021.7.0_gcc-10.4.0                 openjdk/1.8.0_265-b01_gcc-10.4.0                     vtk/9.0.3_gcc-10.4.0-intelmpi
  intel-oneapi-dpl/2022.0.0_gcc-10.4.0          (D)    openmpi/4.1.4_gcc-10.4.0                             vtk/9.0.3_gcc-10.4.0-openmpi                           (D)
  intel-oneapi-inspector/2022.1.0_gcc-10.4.0           openmpi/4.1.5_gcc-10.4.0                      (D)
  intel-oneapi-inspector/2023.0.0_gcc-10.4.0    (D)    petsc/3.17.4_gcc-10.4.0-intelmpi
 
 ------------------------------------------------------------------------ /grid5000/spack/modules-others/modules -------------------------------------------------------------------------
  conda/23.3.1    conda/23.5.0 (D)    ddt/20.1.2    matlab/R2022a    matlab/R2022b (D)    matlab-runtime/R2022a    matlab-runtime/R2022b (D)
 
 Where:
  D:  Default Module
 
 Use "module spider" to find all possible modules.
 Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
Note.png Note

If you need additional software to be installed, feel free to contact Grid5000 support team and we can look into it.

To load something into your environment use the load command:

$ module load gcc
$ gcc --version
gcc (Spack GCC) 12.2.0

By default, module loads the latest version available of a software (sorted by lexicographical order). You can also specify the version you need:

$ module load gcc/10.4.0_gcc-10.4.0
$ gcc --version
gcc (Spack GCC) 10.4.0

You can also find out more information about the package using whatis or show commands:

$ module whatis gcc
$ module show gcc

If you want to unload one or all the currently loaded modules, you can use:

$ module unload gcc
$ module purge

The full documentation of module command is available at: http://modules.sourceforge.net/

Modules that require connection to license server

Some modules are licensed and require a connection to a license server.

We currently propose two license protected modules, Matlab and DDT/Map.

At the time of this writing (beg. May, 2023), in order to use both of them, it is required for the user to:

  • have an access to a license server from her laptop/workstation (either being connected to the user laboratory network, or connected via an institutional VPN)
  • and at the same time, connect to the reserved node with a special SSH ports redirection, as explained below.

We plan to simplify this process for Inria users by providing an automatic access to some Institutional license servers (based on the user belonging to a Granting Group Access - GGA).

Matlab example

In the following example, we are using the Université de Lorraine license server to run matlab.

  • Connect from your workstation to your previously reserved node with a ssh port redirection.

typically, for port 27000 only:

 (workstation):~$ ssh -R 27000:<token.licenceserver.tld>:27000 <node>.<site>.g5k
 (workstation):~$ ssh -R 27000:flexlm1.univ-lorraine.fr:27000 -R 27001:flexlm1.univ-lorraine.fr:27001 <node>.<site>.g5k
  • Set up the link to your Matlab License server through your ssh connection, typically:
 (node):~$ export LM_LICENSE_FILE=27000@127.0.0.1
  • Load the Matlab module named matlab (with version accordingly to your provided licence), for example:
 (node):~$ module load matlab/R2022a
  • Start Matlab without graphical environment:
 (node):~$ matlab -nodisplay -nodesktop -nosplash

Note: No Matlab License server is needed to use Matlab Runtime on nodes.

DDT/Map example

In the following example, we are using the Inria license server to run ddt because, currently, the DDT/Map module is supported only for Inria members.

  • Connect from your workstation to your previously reserved node with a ssh port redirection.
 (workstation) % ssh -YC -R 4241:jetons.inria.fr:4241 <node>.<site>.g5k
  • Load the Matlab module named ddt (with version accordingly to your provided licence), for example:
 (node):~$ module load ddt
  • Start DDT using the GUI:
 (node):~$ ddt

Sharing modules between users

Modules can be shared between users by using a group storage.

Note.png Note

This documentation assume that you already know what is a group storage, and that you already have one for storing your modules. If it's not the case, check the Group Storage Documentation.

Put the modules in a dedicated folder of the group storage, so that the modules are reachable by any user belonging to the group storage.

Terminal.png access:
rsync modules-dir/ /srv/my-storage@storage_fqdn/modules-dir

After adding the directory to the MODULEPATH environment variable, the modules inside this directory will be loadable by other users of the group. This can be done by using one of the two following commands.

Terminal.png node:
module use /srv/my-storage@storage_fqdn/modules-dir

or

Terminal.png node:
export MODULEPATH=/srv/my-storage@storage_fqdn/modules-dir:$MODULEPATH


Finally, the modules can be loaded.

Terminal.png node:
module load my-personal-module


If you are not familiar with modules, you will find here a sample setup to build and share a set of modules of your own.