Actions

Load modules

From ALICE Documentation

Revision as of 12:19, 7 April 2020 by Dijkbvan (talk | contribs) (Created page with "===Load modules=== To load a software module, use <code>module load</code>. In the example below, we will use Python 3. <br />Initially, Python 3 is not loaded. We can test t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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