Multiple versions of the same program can be installed on a cluster. Each version uses different programming libraries depending on the compiler used, compilation options, etc. Before using a particular version, the required modules must be available to the program. The module command is used to set the program's working environment with respect to these dependencies.
Modules ara available after submitting an interactive task using the sub-interactive, srun command or a batch task.
Modules are not available on the ui access node. The sub-* scripts are dedicated to be executed on ui and are configured to load all required modules.
To display a list of available modules, type the command:
abcd@r31c03b03 ~ $ module avail
ABINIT/9.4.1-intel-2020b GCC/9.3.0 Libint/2.6.0-GCC-10.2.0-lmax-6-cp2k PCRE2/10.40-GCCcore-11.3.0
ABINIT/9.4.2-foss-2021a GCC/10.2.0 libjpeg-turbo/2.0.3-GCCcore-8.3.0 Perl/5.28.0-GCCcore-7.3.0
ABINIT/9.6.2-intel-2021a GCC/10.3.0 libjpeg-turbo/2.0.4-GCCcore-9.3.0 Perl/5.28.1-GCCcore-8.2.0
We can also provide the name of the module we are interested in to see a list of available versions:
abcd@r31c03b03 ~ $ module avail openmpi
OpenMPI/3.1.1-GCC-7.3.0-2.30 OpenMPI/4.0.3-GCC-9.3.0 OpenMPI/4.0.5-gcccuda-2020b OpenMPI/4.1.1-GCC-11.2.0
OpenMPI/3.1.3-GCC-8.2.0-2.31.1 OpenMPI/4.0.5-GCC-10.2.0 OpenMPI/4.1.1-GCC-10.3.0 OpenMPI/4.1.2-GCC-11.2.0
To load a specific module into the environment, simply use the command:
abcd@r31c03b03 ~ $ module load OpenMPI/3.1.1-GCC-7.3.0-2.30
To display a list of currently loaded modules:
abcd@r31c03b03 ~ $ module list
OpenMPI/3.1.1-GCC-7.3.0-2.30
To unload a module, use the command:
abcd@r31c03b03 ~ $ module unload OpenMPI/3.1.1-GCC-7.3.0-2.30
or to remove all modules from the environment:
abcd@r31c03b03 ~ $ module purge
The full list of available options can be obtained using man module.