Actions

Accessing software

From ALICE Documentation

Before we start using individual software packages, we need to understand why multiple versions of software are available on HPC systems and why users need to have a way to control which version they are using. The three biggest factors are:

  • software incompatibilities;
  • versioning;
  • dependencies.

Software incompatibility is a major headache for programmers. Sometimes the presence (or absence) of a software package will break others that depend on it. Two of the most famous examples are Python 2 and 3 and C compiler versions. Python 3 famously provides a python command that conflicts with that provided by Python 2. Software compiled against a newer version of the C libraries and then used when they are not present will result in a nasty 'GLIBCXX_3.4.20' not found error, for instance.

Software versioning is another common issue. A team might depend on a certain package version for their research project - if the software version was to change (for instance, if a package was updated), it might affect their results. Having access to multiple software versions allow a set of researchers to prevent software versioning issues from affecting their results.

Dependencies are where a particular software package (or even a particular version) depends on having access to another software package (or even a particular version of another software package). For example, the VASP materials science software may depend on having a particular version of the FFTW (Fastest Fourier Transform in the West) software library available for it to work.

Environment modules

Environment modules are the solution to these problems. A module is a self-contained description of a software package - it contains the settings required to run a software package and, usually, encodes required dependencies on other software packages.

There are a number of different environment module implementations commonly used on HPC systems: the two most common are TCL modules and Lmod. Both of these use similar syntax and the concepts are the same so learning to use one will allow you to use whichever is installed on the system you are using. In both implementations the module command is used to interact with environment modules. An additional subcommand is usually added to the command to specify what you want to do. For a list of subcommnands you can use module -h or module help. As for all commands, you can access the full help on the man pages with man module.

On login you may start out with a default set of modules loaded or you may start out with an empty environment, this depends on the setup of the system you are using.

List currently loaded modules

The module list command shows which modules you currently have loaded in your environment. If you have no modules loaded, you will see a message telling you so

 [remote]$ module list
 No Modulefiles Currently Loaded.

List available modules

To see the available modules, use module -d avail. Note the -d option to only show the default versions of the modules. There are also older versions, that might be used if necessary, but will only clutter the output. You can see all version by omitting the -d option.

 [deuler@nodelogin01 ~]$ module -d avail
  ------------------------------------------------ /cm/shared/easybuild/modules/all -------------------------------------------------
  AMUSE-Miniconda2/4.7.10                                         VTK/8.2.0-foss-2019b-Python-3.7.4
  AMUSE-VADER/12.0.0-foss-2018a-Python-2.7.14                     WebKitGTK+/2.24.1-GCC-8.2.0-2.31.1
  AMUSE/12.0.0-foss-2018a-Python-2.7.14                           X11/20190717-GCCcore-8.3.0
  ATK/2.32.0-GCCcore-8.2.0                                        XML-Parser/2.44_01-GCCcore-7.3.0-Perl-5.28.0
  Autoconf/2.69-GCCcore-8.3.0                                     XZ/5.2.4-GCCcore-8.3.0
  Automake/1.16.1-GCCcore-8.3.0                                   Yasm/1.3.0-GCCcore-8.3.0
  Autotools/20180311-GCCcore-8.3.0                                ZeroMQ/4.3.2-GCCcore-8.2.0
  Bazel/0.20.0-GCCcore-8.2.0                                      amuse-framework/12.0.0-foss-2018a-Python-2.7.14
  Bison/3.3.2                                                     at-spi2-atk/2.32.0-GCCcore-8.2.0
  Boost.Python/1.67.0-foss-2018b-Python-3.6.6                     at-spi2-core/2.32.0-GCCcore-8.2.0
  Boost/1.71.0-gompi-2019b                                        binutils/2.32
  CGAL/4.11.1-foss-2018b-Python-3.6.6                             bokeh/1.3.4-foss-2019a-Python-3.7.2
  CMake/3.15.3-GCCcore-8.3.0                                      bzip2/1.0.8-GCCcore-8.3.0
  CUDA/10.1.243-GCC-8.3.0                                         cURL/7.66.0-GCCcore-8.3.0
  Chimera/1.13.1-linux_x86_64                                     cairo/1.16.0-GCCcore-8.3.0
  Clang/9.0.1-GCC-8.3.0-CUDA-10.1.243                             cairomm/1.12.2-GCCcore-7.3.0
  Cython/0.29.3-foss-2019a-Python-3.7.2                           ctffind/4.1.13-foss-2019a
  DBus/1.13.12-GCCcore-8.3.0                                      cuDNN/7.6.4.38-gcccuda-2019b
  DIAMOND/0.9.22-foss-2018b                                       dask/2.3.0-foss-2019a-Python-3.7.2
  Docutils/0.9.1-foss-2018a-Python-2.7.14                         double-conversion/3.1.4-GCCcore-8.3.0
  Doxygen/1.8.16-GCCcore-8.3.0                                    expat/2.2.7-GCCcore-8.3.0
  EMAN2/2.3                                                       fastp/0.20.0-GCC-8.2.0-2.31.1
  EasyBuild/4.1.1                                                 flex/2.6.4
  Eigen/3.3.4                                                     fontconfig/2.13.1-GCCcore-8.3.0
  FFTW/3.3.8-gompic-2019b                                         foss/2019b
  FFmpeg/4.2.1-GCCcore-8.3.0                                      fosscuda/2019b
  FLTK/1.3.4-foss-2017b                                           freeglut/3.2.1-GCCcore-8.3.0
  FSL/5.0.11-foss-2018b                                           freetype/2.10.1-GCCcore-8.3.0
  FastQC/0.11.8-Java-1.8                                          gcccuda/2019b
  FriBidi/1.0.5-GCCcore-8.3.0                                     gensim/3.7.3-foss-2019a-Python-3.7.2
  GCC/8.3.0                                                       gettext/0.20.1-GCCcore-8.3.0
  GCCcore/8.3.0                                                   gflags/2.2.2-GCCcore-8.3.0
  GLib/2.62.0-GCCcore-8.3.0                                       giflib/5.1.4-GCCcore-8.2.0
  GLibmm/2.49.7-GCCcore-8.3.0                                     git/2.16.1-foss-2018a
  GMP/6.1.2-GCCcore-8.3.0                                         glog/0.4.0-GCCcore-8.3.0
  GObject-Introspection/1.60.1-GCCcore-8.2.0-Python-3.7.2         gompi/2019b
  GROMACS/2019.3-fosscuda-2019a                                   gompic/2019b
  GSL/2.6-GCC-8.3.0                                               gperf/3.1-GCCcore-8.3.0
  GST-plugins-base/1.16.0-GCC-8.2.0-2.31.1                        graph-tool/2.27-foss-2018b-Python-3.6.6
  GStreamer/1.16.0-GCC-8.2.0-2.31.1                               h5py/2.9.0-fosscuda-2019a
  GTK+/3.24.8-GCCcore-8.2.0                                       help2man/1.47.8-GCCcore-8.3.0
  Gctf/1.06                                                       hwloc/1.11.12-GCCcore-8.3.0
  Gdk-Pixbuf/2.38.1-GCCcore-8.2.0                                 hypothesis/4.44.2-GCCcore-8.3.0-Python-3.7.4
  Ghostscript/9.50-GCCcore-8.3.0                                  icc/2019.2.187-GCC-8.2.0-2.31.1
  HDF5/1.10.5-gompic-2019b                                        iccifort/2019.2.187-GCC-8.2.0-2.31.1
  HarfBuzz/2.4.0-GCCcore-8.2.0                                    ifort/2019.2.187-GCC-8.2.0-2.31.1
  ICU/64.2-GCCcore-8.3.0                                          iimpi/2019.02
  IMOD/4.10.28_RHEL7-64_CUDA8.0                                   imkl/2019.2.187-iimpi-2019.02
  IPython/7.7.0-foss-2019a-Python-3.7.2                           impi/2019.2.187-iccifort-2019.2.187-GCC-8.2.0-2.31.1
  ImageMagick/7.0.9-5-GCCcore-8.3.0                               intel/2019.02
  JasPer/2.0.14-GCCcore-8.3.0                                     intltool/0.51.0-GCCcore-8.3.0
  Java/11.0.2                                             (11)    jbigkit/2.1-GCCcore-8.2.0
  LAME/3.100-GCCcore-8.3.0                                        libGLU/9.0.1-GCCcore-8.3.0
  LLVM/9.0.0-GCCcore-8.3.0                                        libdrm/2.4.99-GCCcore-8.3.0
  LibSoup/2.66.1-GCCcore-8.2.0                                    libepoxy/1.5.3-GCCcore-8.2.0
  LibTIFF/4.0.10-GCCcore-8.3.0                                    libevent/2.1.11-GCCcore-8.3.0
  LittleCMS/2.9-GCCcore-8.3.0                                     libffi/3.2.1-GCCcore-8.3.0
  M4/1.4.18                                                       libgcrypt/1.8.4-GCCcore-8.2.0
  MATLAB/2019a                                                    libgd/2.2.5-GCCcore-8.3.0
  MPFR/4.0.2-GCCcore-8.3.0                                        libgpg-error/1.36-GCCcore-8.2.0
  Mako/1.1.0-GCCcore-8.3.0                                        libjpeg-turbo/2.0.3-GCCcore-8.3.0
  Mesa/19.1.7-GCCcore-8.3.0                                       libpciaccess/0.14-GCCcore-8.3.0
  Meson/0.51.2-GCCcore-8.3.0-Python-3.7.4                         libpng/1.6.37-GCCcore-8.3.0
  Miniconda2/4.7.10                                               libpsl/0.21.0-GCCcore-8.2.0
  Miniconda3/4.7.10                                               libreadline/8.0-GCCcore-8.3.0
  MotionCor2/1.3.0-GCCcore-8.2.0                                  libsigc++/2.10.2-GCCcore-8.3.0
  MultiQC/1.7-foss-2018b-Python-3.6.6                             libsndfile/1.0.28-GCCcore-8.3.0
  NASM/2.14.02-GCCcore-8.3.0                                      libsodium/1.0.17-GCCcore-8.2.0
  NCCL/2.4.8-gcccuda-2019b                                        libtasn1/4.13-GCCcore-8.2.0
  NLTK/3.2.4-foss-2019a-Python-3.7.2                              libtool/2.4.6-GCCcore-8.3.0
  NLopt/2.6.1-GCCcore-8.3.0                                       libunwind/1.3.1-GCCcore-8.3.0
  NSPR/4.21-GCCcore-8.3.0                                         libwebp/1.0.2-GCCcore-8.2.0
  NSS/3.45-GCCcore-8.3.0                                          libxml++/2.40.1-GCCcore-8.3.0
  Ninja/1.9.0-GCCcore-8.3.0                                       libxml2/2.9.9-GCCcore-8.3.0
  OpenBLAS/0.3.7-GCC-8.3.0                                        libxslt/1.1.33-GCCcore-8.2.0
  OpenJPEG/2.3.1-GCCcore-8.2.0                                    libyaml/0.2.2-GCCcore-8.3.0
  OpenMPI/3.1.4-gcccuda-2019b                                     magma/2.5.1-fosscuda-2019b
  OpenPGM/5.2.122-GCCcore-8.2.0                                   matplotlib/3.1.1-foss-2019b-Python-3.7.4
  PCRE/8.43-GCCcore-8.3.0                                         mpi4py/3.0.0-foss-2018a-Python-2.7.14
  PCRE2/10.33-GCCcore-8.3.0                                       ncurses/6.1-GCCcore-8.3.0
  Pango/1.43.0-GCCcore-8.2.0                                      netCDF/4.7.1-gompi-2019b
  Perl/5.30.0-GCCcore-8.3.0                                       nettle/3.5.1-GCCcore-8.3.0
  Pillow/6.2.1-GCCcore-8.3.0                                      nodejs/10.15.1-foss-2018a
  PyCairo/1.18.0-foss-2018b-Python-3.6.6                          numactl/2.0.12-GCCcore-8.3.0
  PyTorch/1.3.1-fosscuda-2019b-Python-3.7.4                       pandas/0.24.0-foss-2019a-Python-3.7.2
  PyYAML/5.1.2-GCCcore-8.3.0                                      pip/19.1.1-foss-2018a-Python-2.7.14
  Python/3.7.4-GCCcore-8.3.0                                      pixman/0.38.4-GCCcore-8.3.0
  Qt5/5.13.1-GCCcore-8.3.0                                        pkg-config/0.29.2-GCCcore-8.3.0
  Qwt/6.1.4-GCCcore-8.3.0                                         pkgconfig/1.5.1-GCCcore-8.2.0-python
  R/3.6.2-fosscuda-2019b                                          pocl/1.4-gcccuda-2019b
  RELION/3.0.4-foss-2017b                                         protobuf/3.6.1.2-GCCcore-8.2.0
  ResMap/1.1.4linux64                                             pytest/3.8.0-foss-2018a-Python-3.6.4
  Ruby/2.6.3-GCCcore-8.2.0                                        re2c/1.2.1-GCCcore-8.3.0
  SCons/3.1.1-GCCcore-8.3.0                                       requests/2.10.0-foss-2019a-Python-3.7.2
  SDL2/2.0.9-GCCcore-8.2.0                                        scikit-learn/0.20.3-foss-2019a
  SPAdes/3.13.0-foss-2018b                                        snappy/1.1.7-GCCcore-8.3.0
  SQLite/3.29.0-GCCcore-8.3.0                                     sparsehash/2.0.3-GCCcore-7.3.0
  ScaLAPACK/2.0.2-gompic-2019b                                    tbb/2018_U5-GCCcore-6.4.0
  SciPy-bundle/2019.10-fosscuda-2019b-Python-3.7.4                util-linux/2.34-GCCcore-8.3.0
  Singularity/2.2.1-GCC-6.3.0-2.27                                wheel/0.32.0-foss-2018a-Python-2.7.14
  Szip/2.1.1-GCCcore-8.3.0                                        wxWidgets/3.0.4-GCC-8.2.0-2.31.1
  Tcl/8.6.9-GCCcore-8.3.0                                         x264/20190925-GCCcore-8.3.0
  TensorFlow/1.13.1-fosscuda-2019a-Python-3.7.2                   x265/3.2-GCCcore-8.3.0
  Tk/8.6.9-GCCcore-8.3.0                                          xorg-macros/1.19.2-GCCcore-8.3.0
  Tkinter/3.7.4-GCCcore-8.3.0                                     xprop/1.2.2-GCCcore-6.4.0
  UDUNITS/2.2.26-GCCcore-8.3.0                                    zlib/1.2.11
 
 ------------------------------------------------------------------------ /cm/local/modulefiles ------------------------------------------------------------------------
  cluster-tools/8.2    cmd      dot               gcc/8.2.0          lua/5.3.5     module-info    openldap    python36
  cm-cloud-copy/8.2    cmsub    freeipmi/1.6.2    ipmitool/1.8.18    module-git    null           python2     shared   (L)
 
 ----------------------------------------------------------------------- /usr/share/modulefiles ------------------------------------------------------------------------
  DefaultModules (L)
 
 ----------------------------------------------------------------------- /cm/shared/modulefiles ------------------------------------------------------------------------
  LUMC/default                         fftw2/openmpi/gcc/64/float/2.1.5    hpl/2.2                                   netcdf/gcc/64/4.6.1
  blacs/openmpi/gcc/64/1.1patch03      fftw3/openmpi/gcc/64/3.3.8          intel-tbb-oss/ia32/2019_20190410oss       netperf/2.7.0
  blas/gcc/64/3.8.0                    gcc6/6.5.0                          intel-tbb-oss/intel64/2019_20190410oss    openblas/dynamic/0.2.20
  bonnie++/1.97.3                      gdb/8.2                             iozone/3_482                              openmpi/gcc/64/1.10.7
  cm-pmix3/3.1.4                       globalarrays/openmpi/gcc/64/5.7     lapack/gcc/64/3.8.0                       scalapack/openmpi/gcc/64/2.0.2
  default-environment                  hdf5/1.10.1                         mpich/ge/gcc/64/3.3                       sge/2011.11p1
  fftw2/openmpi/gcc/64/double/2.1.5    hdf5_18/1.8.20                      mvapich2/gcc/64/2.3                       slurm/19.05.1                  (L)
 
 Where:
  L:        Module is loaded
  Aliases:  Aliases exist: foo/1.2.3 (1.2) means that "module load foo/1.2" will load foo/1.2.3
 
 Module defaults are chosen based on Find First Rules due to Name/Version/Version modules found in the module tree.
 See https://lmod.readthedocs.io/en/latest/060_locating.html for details.
 
 Use "module spider" to find all possible modules.
 Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

Load modules

To load a software module, use module load. In the example below, we will use Python 3.


Initially, Python 3 is not loaded. We can test this by using the command which that looks for programs the same way that Bash does. We can use it to tell us where a particular piece of software is stored.

[deuler@nodelogin01 ~]$ which python3
/usr/bin/which: no python3 in (/cm/shared/apps/slurm/18.08.4/sbin:/cm/shared/apps/slurm/18.08.4/bin:/cm/local/apps/gcc/8.2.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/deuler/.local/bin:/home/deuler/bin)


We can load the python3 command with module load:

[deuler@nodelogin01 ~]$ module load Python/3.7.2-GCCcore-8.2.0
[deuler@nodelogin01 ~]$ which python3
/cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin/python3


So what just happened? To understand the output, first we need to understand the nature of the $PATH environment variable. $PATH is a special environment variable that controls where a Linux operating system (OS) looks for software. Specifically $PATH is a list of directories (separated by :) that the OS searches through for a command. As with all environment variables, we can print it using echo.


 [remote]$ echo $PATH
 /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/XZ/5.2.4-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/SQLite/3.27.2-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/Tcl/8.6.9-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/libreadline/8.0-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/ncurses/6.1-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/bzip2/1.0.6-GCCcore-8.2.0/bin:/cm/shared/easybuild/software/GCCcore/8.2.0/bin:/cm/shared/apps/slurm/18.08.4/sbin:/cm/shared/apps/slurm/18.08.4/bin:/cm/local/apps/gcc/8.2.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/deuler/.local/bin:/home/deuler/bin

You’ll notice a similarity to the output of the which command. In this case, there’s only one difference: the /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin directory at the beginning. When we used module load Python/3.7.2-GCCcore-8.2.0, it added this directory to the beginning of our $PATH. Let’s examine what is there:

 [deuler@nodelogin01 ~]$ \ls /cm/shared/easybuild/software/Python/3.7.2-GCCcore-8.2.0/bin
 
 2to3		  futurize	 pip	      pytest		 python3-config  rst2odt_prepstyles.py	sphinx-apidoc
 2to3-3.7	  idle3		 pip3	      py.test		 pyvenv		 rst2odt.py		sphinx-autogen
 chardetect	  idle3.7	 pip3.7       python		 pyvenv-3.7	 rst2pseudoxml.py	sphinx-build
 cygdb		  netaddr	 pybabel      python3		 rst2html4.py	 rst2s5.py		sphinx-quickstart
 cython		  nosetests	 __pycache__  python3.7		 rst2html5.py	 rst2xetex.py		tabulate
 cythonize	  nosetests-3.7  pydoc3       python3.7-config	 rst2html.py	 rst2xml.py		virtualenv
 easy_install	  pasteurize	 pydoc3.7     python3.7m	 rst2latex.py	 rstpep2html.py		wheel
 easy_install-3.7  pbr		 pygmentize   python3.7m-config  rst2man.py	 runxlrd.py


Taking this to its conclusion, module load adds software to your $PATH. It “loads” software. A special note on this, depending on which version of the module program that is installed at your site, module load may also load required software dependencies.

 [deuler@nodelogin01 ~]$ module list
 Currently Loaded Modules:
   1) shared           5) GCCcore/8.2.0               9) libreadline/8.0-GCCcore-8.2.0  13) GMP/6.1.2-GCCcore-8.2.0
   2) DefaultModules   6) bzip2/1.0.6-GCCcore-8.2.0  10) Tcl/8.6.9-GCCcore-8.2.0        14) libffi/3.2.1-GCCcore-8.2.0
   3) gcc/8.2.0        7) zlib/1.2.11-GCCcore-8.2.0  11) SQLite/3.27.2-GCCcore-8.2.0    15) Python/3.7.2-GCCcore-8.2.0
   4) slurm/18.08.4    8) ncurses/6.1-GCCcore-8.2.0  12) XZ/5.2.4-GCCcore-8.2.0

Unload modules

The command module unload “un-loads” a module along with its dependencies. For the above example:

 [deuler@nodelogin01 ~]$ module unload Python/3.7.2-GCCcore-8.2.0
 [deuler@nodelogin01 ~]$ module list
 Currently Loaded Modules:
   1) shared           5) GCCcore/8.2.0               9) libreadline/8.0-GCCcore-8.2.0  13) GMP/6.1.2-GCCcore-8.2.0
   2) DefaultModules   6) bzip2/1.0.6-GCCcore-8.2.0  10) Tcl/8.6.9-GCCcore-8.2.0        14) libffi/3.2.1-GCCcore-8.2.0
   3) gcc/8.2.0        7) zlib/1.2.11-GCCcore-8.2.0  11) SQLite/3.27.2-GCCcore-8.2.0
   4) slurm/18.08.4    8) ncurses/6.1-GCCcore-8.2.0  12) XZ/5.2.4-GCCcore-8.2.0


The command module purge unloads everything at once.

 [deuler@nodelogin01 ~]$ module purge
 [deuler@nodelogin01 ~]$ module list
 No modules loaded