Knowledge Base

Accessing Software on the Cluster

On the Reading Academic Computing cluster and the met-cluster the locally built software packages are not available right away. They can be loaded into your environment using environmental modules (http://modules.sourceforge.net/). The ‘module’ command modify your environmental variables and in particular change the version of software that you use by changing the PATH and other environment variables. The strength of this approach is that it works with all shells and that you can unload modules as opposed to having to start a new shell to get a clean environment. The old command ‘setup’ is no longer supported on the met-cluster and is not available for new user accounts.

Listing available modules

You can list the available software modules on the cluster with the command

module avail

Note that you’ll have to be on one of the compute nodes on the cluster to see the full range of available software as the head node only has a limited amount of applications available.

If you want to find out what versions of a module are available, for example gcc, then you can specify this in the above command, e.g.:

module avail gcc

This will show a list of all available versions of gcc in an output like this:

metclc0.local$ module avail gcc

-------------------------- /opt/software/modules/UoR ---------------------------
gcc/3.2.2 gcc/4.9.2 gcc/5.2.0(default)
gcc/4.4.7 gcc/5.1.0 gcc/7.2.0

-------------------------- /opt/software/modules/Met ---------------------------
gcc-5.2.0

 

Loading a module

You can load a module, e.g. gcc, using the command

module load gcc

or

module add gcc

The will load a default value of the module, which is indicated by ‘(default)’ in the output from ‘module avail gcc’. If you want a specific version, for example gcc 4.9.2 then append the version to the above command:

module load gcc/4.9.2

 

Listing loaded modules

You can list the modules that you have loaded with the command

module list

 

Switching between module versions

If you want to change the version of a module you have loaded, for example from gcc version 4.9.2 to 5.2.0, then you can use the command

module switch gcc/5.2.0

 

Adding your own module files

If you have a directory of your own modules in your home directory, in /home/username/privatemodules, then you can make them available to load with the command

module use ~/privatemodules

This can also be done by adding the module ‘use.own’ and it has the advantage that you can call it many times without it being added more than once.

module load use.own

 

Setting preferred module versions

You can use your own modules as a way of loading your preferred versions of a module. If you then change your module preferences you only need to update one file.

The following example shows the contents of a sample file called e.g. ‘mypython’, which could be used to set up your preferred version of the python module (shown here for canopy-1.7.2).

#%Module1.0#####################################################################
##
## use.own modulefile
##
## modulefiles/use.own.  Generated from use.own.in by configure.
##
proc ModulesHelp { } {
global version

puts stderr "\tThis module adds my prefered version of python"
puts stderr "\n\tVersion $version\n"
}

module-whatis    "adds my prefered version of python"

set    version    canopy-1.7.2
module    load    python/$version

When this is set up and you want to load python you would need to load the two modules

module load use.own
module load mypython

Your personal module file could also be used to load multiple modules.

 

Module, Python & TCL

Unfortunately ‘python’ and ‘module’ use incompatible versions of the scripting language tcl, which means that once you have loaded python the ‘module’ command will not fully work.

A workaround is to start a new shell (e.g. bash or ksh) before you load python and make sure that python is the last module you are loading. You can then simply exit the shell if you want to change the version of python. This is an example of the series of commands described above:

metclc0.local$ bash
metclc0.local$ module load python/anaconda3
metclc0.local$ which python
/home/opt-user/Linux-opt/python/anaconda3/bin/python
metclc0.local$ python
Python 3.5.1 |Anaconda custom (64-bit)| (default, Dec  7 2015, 11:16:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit();
metclc0.local$ exit
metclc0.local$ module list
Currently Loaded Modulefiles:
1) rocks-openmpi