5. Using the module environment

On HECToR facilities the module environment is widely used to manage the components of the systems software and also several supported application packages.

5.1 Information on the available modules

If you are looking for an application, library or tool on HECToR facilities , it might be installed already and ready to use. A simple module avail will list the modules available:

user@nid00004:~> module avail
--------------------- /opt/cray/xt-asyncpe/3.3/modulefiles ---------------------
xtpe-barcelona     xtpe-quadcore      xtpe-target-native
xtpe-istanbul      xtpe-shanghai

------------------- /opt/totalview-support/1.0.6/modulefiles -------------------
xt-totalview-mem-debug

------------------------------- /opt/modulefiles -------------------------------
Base-opts/2.0.05                     petsc-complex/3.0.0.3
Base-opts/2.0.10                     petsc-complex/3.0.0.4
Base-opts/2.0.17                     petsc-complex/3.0.0.6
Base-opts/2.0.20                     petsc-complex/3.0.0.7
Base-opts/2.0.40                     pgi/6.2.4
Base-opts/2.0.40.lusrelsave          pgi/6.2.5
Base-opts/2.0.49                     pgi/7.1.4
Base-opts/2.0.49.lusrelsave          pgi/7.2.2
Base-opts/2.0.53                     pgi/7.2.3
Base-opts/2.0.53.lusrelsave          pgi/7.2.4
Base-opts/2.0.62                     pgi/7.2.5
Base-opts/2.0.62.lusrelsave          pgi/8.0.1
Base-opts/2.1.50HD                   pgi/8.0.2(default)

...

This will list all the names and versions of the modules available on the service. Not all of them will work in your account though, due to e.g. licencing restrictions. You will notice, for many modules we have more than one version, typically identified by their version number. One of these versions is marked as the default. As the service gets developed, the default will move. The webpage:

Default module versions on HECToR

provides a time line of the default versions for a number of key components of the system software.

If you want more info on any of the modules, try module help:

aturner@hector-xe6-1:~> module help castep

----------- Module Specific Help for 'castep/5.5' -----------------

	CASTEP 5.5
	============

	This module sets up your environment to access CASTEP 5.5.
	Once loaded you can access the CASTEP executable using the
	name 'castep'.

	An executable with debugging symbols is also available as
	'castep.debug'.

	You can find example job submission scripts, compilation
	instructions and more details on the HECToR User Wiki:

		https://wiki.hector.ac.uk/userwiki/CASTEP

	For access to CASTEP please contact the HECToR helpdesk
	at helpdesk@hector.ac.uk

	Installed by: A. Turner, EPCC
	Date: 17 February 2011

A simple module list will give the names of the modules and their versions you have presently loaded

user@nid00004:~> module list           
Currently Loaded Modulefiles:
  1) modules/3.1.6                 11) xt-pe/2.1.56HDA
  2) MySQL/5.0.45                  12) xt-asyncpe/3.3
  3) pbs/10.0.1.83201              13) PrgEnv-pgi/2.1.56HDA
  4) packages                      14) xt-service/2.1.56HDA
  5) pgi/8.0.2                     15) xt-libc/2.1.56HDA
  6) totalview-support/1.0.6       16) xt-os/2.1.56HDA
  7) xt-totalview/8.6.0            17) xt-boot/2.1.56HDA
  8) fftw/3.1.1                    18) xt-lustre-ss/2.1.56HDA_1.6.5
  9) xt-libsci/10.3.2              19) xtpe-target-cnl
 10) xt-mpt/3.1.0                  20) Base-opts/2.1.56HDA

5.2 Loading, unloading and swapping modules

To load a module to use module add

  module add xt-libsci

will load the default version of the Cray Scientific Library, libsci. If you need a specfic version of this,

  module add  xt-libsci/10.3.4

will load version 10.3.4 for you, regardless of the default.

If you want to clean up, module remove will remove a loaded module

  module remove xt-libsci

will unload what ever version of the libsci (even if it is not the default) you might have loaded. There are many situations in which you might want to change the presently loaded version against a different one, e.g. trying the latest version which is not yet the default or using a legacy version to keep compatibility with old data. This can be achieved easiest by using module swap oldmodule newmodule. Suppose you have loaded version 10.3.2 of libsci,

  module swap xt-libsci/10.3.2 xt-libsci/10.3.4

will change to version 10.3.4.

Additional help on using modules is available

  module -h

5.3 Things to watch out for

Modules can depend or conflict with each other. In many cases modules are guarded against conflict. If you have loaded fftw/3.1.1 loading fftw/2.1.5 would lead to conflict. If you try this, you get

  user@nid00004:~> module load fftw/2.1.5
  fftw/2.1.5(9):ERROR:150: Module 'fftw/2.1.5' conflicts with the 
                                     currently loaded module(s) 'fftw/3.1.1'
  fftw/2.1.5(9):ERROR:102: Tcl command execution failed: conflict fftw/3.1.1

which tells you about the conflict. To resolve this use module swap fftw/3.1.1 fftw/2.1.5 instead.

For the compilers to work correctly, you have to make sure you have the right PrgEnv module loaded. How to use the compiler modules is described in detail in the Compilation section:

Compilation

4. Resource management | Contents | 6. Running jobs