Modules

Access to software is controlled by modules which configure your environment to use specific applications. Ada uses this method for controlling access to applications, tools and libraries, allowing you to select software options and setup the relevant environment variables. There are a few simple commands which allow you to retrieve information about the software installed (modules) on ada.

Do NOT set modules in .bashrc

Slurm passes the environment (eg modules, python, conda).  If you set these in your .bashrc then it can cause unexpected and unwanted variable assignments when you run slurm jobs (both interactive and sbatch). 

  • Modules should be set explicitly in sbatch scripts
  • frequently used combinations in interactive node can be set as an alias in .bashrc
    eg alias stata16="module add stata/16"
    alias mpi-intel="module add mpi/openmpi/4.0.3/intel/ib"

To view a list of all available modules sorted by department
 

module avail

Note this is split into the following sections :

  • general
  • compilers
  • libraries
  • mth
  • sys
  • che
  • env
  • bio-med

[s154@login01 ~]$ module avail

------------------------ /gpfs/software/ada/modules/cmp ------------------------
keras/2.3.1 pytorch/1.3.1 singularity/3.4.2
------------------------ /gpfs/software/ada/modules/che ------------------------
namd/2.13/cuda
--------------------- /gpfs/software/ada/modules/libraries ---------------------
cudnn/7.6.5 gmp/6.1.2 libdrm/2.4.99 mpc/1.1.0 mpfr/4.0.2
--------------------- /gpfs/software/ada/modules/compilers ---------------------
activeperl/5.28.1 mpi/openmpi/3.1.0/gcc/eth cmake/3.16.0-rc4
mpi/openmpi/4.0.2/gcc/eth gcc/9.2.0 python/3.8 java/jdk1.8.0_231
python/anaconda/2019.10/3.7
.............

The list is long and you may need to scroll up to see the section relevant to you.  If you can't see the one you need, check the other sections before contacting us.

To list modules available in alphabetical order
 

module spider

[s154@c0001 ~]$ module spider
---------------------------------------------------------------------------------------------------------
The following is a list of the modules currently available:
---------------------------------------------------------------------------------------------------------
  R: R/3.6.1
  activeperl: activeperl/5.28.1  
  cmake: cmake/3.16.0-rc4
  cudnn: cudnn/7.6.5
  gcc: gcc/9.2.0
  gmp: gmp/6.1.2
  java: java/jdk1.8.0_231
  keras: keras/2.3.1
  libdrm: libdrm/2.4.99
  mpc: mpc/1.1.0
  mpfr: mpfr/4.0.2
  mpi/openmpi/3.1.0/gcc: mpi/openmpi/3.1.0/gcc/eth
  mpi/openmpi/4.0.2/gcc:mpi/openmpi/4.0.2/gcc/eth
  namd/2.13: namd/2.13/cuda
  nvtop: nvtop/1.0.0
  python/3.8: python/3.8
  python/anaconda/2019.10: python/anaconda/2019.10/3.7
  pytorch: pytorch/1.3.1
  settarg: settarg
  singularity: singularity/3.4.2

To find a specific package
 

module spider Foo   where "Foo" is the name of a module.

[s154@c0006 ~]$ module spider R
----------------------------------------------------------------------------
  R:
----------------------------------------------------------------------------
     Versions:
        R/3.6.1
        R/3.6.2
     Other possible modules matches:
        Bracken  Kraken2  MPlayer  Prodigal  StringTie  Unicycler  activeperl  .
----------------------------------------------------------------------------
  To find other possible module matches execute:
$ module -r spider '.*R.*'
----------------------------------------------------------------------------
  For detailed information about a specific "R" module (including how to load th
e modules) use the module's full name.
  For example:
     $ module spider R/3.6.2
----------------------------------------------------------------------------


To load a module
 

module add <modulename> or module load <modulename> to add the module

To swap to a different module
 

module switch <modulename1> <modulename2>  or module swap <modulename1> <modulename2> 

To unload a module
 

module rm <modulename> or module unload <modulename> or  module del <modulename> to remove the module

To remove all modules
 

module purge

To show the modules you have loaded
 

module list

s154@login01 ~]$ module list Currently Loaded Modules:
  1) gmp/6.1.2   2) mpfr/4.0.2   3) mpc/1.1.0   4) cmake/3.16.0-rc4   5) gcc/9.2.0   6) activeperl/5.28.1

To list the contents of a module file
 

module display <modulename> or module show <modulename>

[s154@login01 ~]$ module show gcc/9.2.0
-----------------------------------------------------------------------------------------------------------------------------------------
   /gpfs/software/ada/modules/compilers/gcc/9.2.0:
-----------------------------------------------------------------------------------------------------------------------------------------
whatis("Adds GCC 9.2.0 Gnu Compiler Collection ")
prepend_path("PATH","/gpfs/software/ada/compilers/gcc/9.2.0/bin")
prepend_path("LD_LIBRARY_PATH","/gpfs/software/ada/compilers/gcc/9.2.0/lib64:/gpfs/software/ada/compilers/gcc/9.2.0/lib")
prepend_path("MANPATH","/gpfs/software/ada/compilers/gcc/9.2.0/share/man")
prepend_path("PKG_CONFIG_PATH","/gpfs/software/ada/compilers/gcc/9.2.0/lib/pkgconfig:/gpfs/software/ada/compilers/gcc/9.2.0/lib64/pkgconfig")
prepend_path("LIBRARY_PATH","/gpfs/software/ada/compilers/gcc/9.2.0/lib64:/gpfs/software/ada/compilers/gcc/9.2.0/lib")
setenv("cc","/gpfs/software/ada/compilers/gcc/9.2.0/bin/gcc")
setenv("cxx","/gpfs/software/ada/compilers/gcc/9.2.0/bin/c++")
conflict("gcc")
load("gmp/6.1.2","mpfr/4.0.2","mpc/1.1.0","cmake/3.16.0-rc4")
help([[Adds GCC 9.2.0 Gnu Compiler Collection]])

This command is useful if you need to know the path for setting environment variables.Particularly useful in finding library paths for the purpose of linking against libraries. Library paths are comma delimited directories that are assigned to the environment variable LD_LIBRARY_PATH