1.  Basic module commands

Modules are a user-friendly interface that provide for the dynamic modification of the user's environment. By using different modules the user does not need to take care of all the environment variables necessary to use properly and practically compilers, libraries and applications.

Modules on the SISSA/Democritos infrastructure are divided in different categories:

  • compilers
  • mpi
  • libraries
  • applications

To see what is available on the resource you're accessing type

$ module avail

and you will be presented with a list of all the modules available on the system that should look like this:

-------------------------------------------------- /opt/Modules/versions ---------------------------------------------------

----------------------------------------------- /opt/Modules/3.2.6/compilers -----------------------------------------------
gnu/4.2             gnu/4.3(default)    intel/10.1(default) intel/11.0          intel/9.1           pgi/7.2-5(default)

----------------------------------------------- /opt/Modules/3.2.6/libraries -----------------------------------------------
acml/4.0.1-intel    acml/4.1.0-pgi      acml/4.2.0-pgi      acml/pgi            fftw3/gnu           mkl/10.0(default)
acml/4.1.0-gnu      acml/4.2.0-gnu      acml/gnu            fftw2/gnu           fftw3/intel         mkl/10.1
acml/4.1.0-intel    acml/4.2.0-intel    acml/intel(default) fftw2/intel         fftw3/pgi

-------------------------------------------------- /opt/Modules/3.2.6/mpi --------------------------------------------------
lam/7.1.4-intel(default)      openmpi/1.2.8-intel(default)  openmpi/1.2.8-pgi             openmpi/1.3/intel/11.0
mvapich2/1.2p1-intel(default) openmpi/1.2.8-intel-11        openmpi/1.3/intel/10.1        openmpi/1.3/intel/9.1
openmpi/1.2.8-gnu             openmpi/1.2.8-intel-mm        openmpi/1.3/intel/10.1-mm

--------------------------------------------- /opt/Modules/3.2.6/applications ----------------------------------------------
cp2k/acml_ser             espresso/acml_ser         gromacs/3.3.3-sp          idl/7.0.3
cp2k/mkl_ser(default)     espresso/mkl_ser(default) gromacs/4.0.2-dp          namd/2.6(default)
cpmd/3.13.2-intel         gromacs/3.3.3-dp          gromacs/4.0.2-sp(default) namd/2.6-meta

To load a module type the module load command followed by the module name reported by module avail, e.g.:

$ module load intel/9.1

To unload a module simply type the module unload command followed by the module name, e.g.:

$ module unload gnu/4.3

To get some information about a module use the module help command followed by the module name, e.g.:

$ module help fftw3/3.2/intel

To see what modules are currently loaded use the module list command and you should see something like

$ module list
Currently Loaded Modulefiles:
  1) openmpi/1.2.8-intel   2) intel/10.1

To unload all the loaded modules at once you can use the module purge command. All the modules you have loaded will be automatically unloaded once you log out of the current shell.

Please note that some modules might conflict with each other. If you try to load them at the same time you will get an error message. Moreover, some modules depend on other modules which are loaded automatically.

2.  Advanced modules use

2.1  Modules versions

Almost all modules are available in different versions that are marked by a / in the module name. So for example we see from the output of the module avail command that the intel module has three versions

----------------------------------------------- /opt/Modules/3.2.6/compilers -----------------------------------------------
gnu/4.2             gnu/4.3(default)    intel/10.1(default) intel/11.0          intel/9.1           pgi/7.2-5(default)

The versions marked as default will be loaded if you don't specify a version, so for example typing

module load intel

will load the Intel compilers version 10.1, while typing

module load intel/9.1

will load Intel compilers version 9.1.

IMPORTANT! If you need to load a module that is not marked as default you must specify the complete module name! If you specify only partially the module version (e.g. openmpi/1.3 instead of openmpi/1.3/intel/10.1) the first module in alphabetical order will be loaded.

2.2  Add your own modules

If you wish to add your own modules you can easily do it by indicating their location with the module use command, e.g. type

$ module use $HOME/my_modules

and all the modules in $HOME/my_modules will be available for you to use. To stop using your own modules you should use the module unuse command in this fashion

$ module unuse $HOME/my_modules

Module files are written in Tcl. To learn how to write your own modules check this page and feel free to take a look at the modules available on the machine you are logged into. To find the where the modules are type