Actions

Difference between revisions of "Accessing software"

From ALICE Documentation

 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category: About ALICE]]
 
 
= Software  =
 
= Software  =
 
Before we start using individual software packages, we need to understand why multiple versions of the software are available on ALICE systems and why users need to have a way to control which version they are using. The three biggest factors are:
 
Before we start using individual software packages, we need to understand why multiple versions of the software are available on ALICE systems and why users need to have a way to control which version they are using. The three biggest factors are:
Line 13: Line 12:
 
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 are the solution to these problems.
 
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 are the solution to these problems.
 
{{:Environment modules}}
 
{{:Environment modules}}
 +
[[Category:Advanced]]
 +
[[Category:About ALICE]]

Latest revision as of 12:04, 29 June 2020

Software

Before we start using individual software packages, we need to understand why multiple versions of the software are available on ALICE 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 are the solution to these problems.

Environment modules

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 sub-command is usually added to the command to specify what you want to do. For a list of sub-commands 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

  [me@nodelogin02~]$ module list
  No modules 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/other versions, that might be used if necessary, but will only clutter the output. You can see all version by omitting the -d option.

 [me@nodelogin02~]$ 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
  etc etc etc .......

If you are searching for a specific software package or tool you can search for the full module name like:

 [me@nodelogin02~]$ module avail python
  ---------------------------------------- /cm/shared/easybuild/modules/all -----------------------------------------
  AMUSE-GPU/12.0.0-foss-2018a-Python-2.7.14
  AMUSE-VADER/12.0.0-foss-2018a-Python-2.7.14
  AMUSE/12.0.0-foss-2018a-Python-2.7.14
  AMUSE/13.1.0-foss-2018a-Python-3.6.4                    (D)
  Biopython/1.71-foss-2018a-Python-2.7.14
  Biopython/1.73-foss-2019a
  Biopython/1.75-foss-2019b-Python-3.7.4                  (D)
  Boost.Python/1.67.0-foss-2018b-Python-3.6.6
  CGAL/4.11.1-foss-2018b-Python-3.6.6
  CONCOCT/1.1.0-foss-2019a-Python-2.7.15
  CheckM/1.0.18-foss-2019a-Python-2.7.15
  Cython/0.25.2-foss-2018a-Python-2.7.14
  Cython/0.25.2-foss-2018a-Python-3.6.4
  Cython/0.29.3-foss-2019a-Python-3.7.2                   (D)
  DAS_Tool/1.1.1-foss-2019a-R-3.6.0-Python-3.7.2
  Docutils/0.9.1-foss-2018a-Python-2.7.14
  Docutils/0.9.1-foss-2018a-Python-3.6.4                  (D)
  GObject-Introspection/1.60.1-GCCcore-8.2.0-Python-3.7.2
  IPython/5.7.0-foss-2018a-Python-2.7.14
  IPython/6.4.0-foss-2018a-Python-3.6.4
  IPython/7.7.0-foss-2019a-Python-3.7.2                   (D)
  Keras/2.2.4-foss-2019a-Python-3.7.2
  Mako/1.0.7-foss-2017b-Python-2.7.14
  Mako/1.0.7-foss-2018a-Python-2.7.14
  Mako/1.0.7-foss-2018b-Python-2.7.15
  Meson/0.50.0-GCCcore-8.2.0-Python-3.7.2
  Meson/0.51.2-GCCcore-8.3.0-Python-3.7.4                 (D)
  MultiQC/1.7-foss-2018b-Python-3.6.6
  NLTK/3.2.4-foss-2018a-Python-3.6.4
  NLTK/3.2.4-foss-2019a-Python-3.7.2                      (D)
  PyCairo/1.18.0-foss-2018b-Python-3.6.6
  PyTorch/1.3.1-fosscuda-2019b-Python-3.7.4
  PyYAML/3.13-foss-2018b-Python-3.6.6
  Python/2.7.14-foss-2017b
  Python/2.7.14-foss-2018a
  Python/2.7.14-GCCcore-6.4.0-bare
  Python/2.7.15-foss-2018b
  Python/2.7.15-GCCcore-7.3.0-bare
  Python/2.7.15-GCCcore-8.2.0
  Python/2.7.16-GCCcore-8.3.0
  Python/3.6.4-foss-2018a
  Python/3.6.6-foss-2018b
  Python/3.7.2-GCCcore-8.2.0
  Python/3.7.4-GCCcore-8.3.0                              (D)
  etc etc etc .......

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.

  [me@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/me/.local/bin:/home/me/bin)


We can load the python3 command with module load:

  [me@nodelogin01 ~]$ module load Python/3.7.2-GCCcore-8.2.0
  [me@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.

  [me@nodelogin01 ~]$ 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/19.05.1/sbin:/cm/shared/apps/slurm/19.05.1/bin:/cm/local/apps/gcc/8.2.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/me/.local/bin:/home/me/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:

   [me@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.

   [me@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/19.05.1    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:

 [me@nodelogin01 ~]$ module unload Python/3.7.2-GCCcore-8.2.0
 [me@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.

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