Loughborough University
Leicestershire, UK
LE11 3TU
+44 (0)1509 222222
Loughborough University

IT Services : High Performance Computing

Environment Module


Introduction

Environment Modules are predefined environmental settings which can be applied and removed dynamically. They are usually used to manage different versions of applications, by modifying shell variables such as PATH and MANPATH .

Modules are controlled through the module command. Common tasks are seeing which modules are available, loading and unloading modules. The following examples show each of these. Be aware that the modules available will differ from one system to the next.

If a module requires other modules to operate (dependencies) these will be loaded automatically. In some instances a module may require other modules that conflict with ones that you already have loaded (e.g. you have thing 1.0 loaded and a module needs thing 2.0) in which case you have to unload the conflicting module first. Sometimes it is possible that a combination of modules will not work together. In those cases contact the HPC team to ask for assistance.

List Available Modules

module avail

------------------------------- /opt/modules/version ---------------------------------
3.1.6

--------------------------- /opt/modules/3.1.6/modulefiles ---------------------------
dot   module-cvs  module-info modules     null  use.own

------------------------------ /opt/modules/modulefiles ------------------------------
intel_compilers/2013sp1     python/3.4.1/default
intel_compilers/xe2015      readline/6.3/default
intel_mkl/2013sp1           sqlite/3080600/default
intel_mkl/xe2015            tau/2.23.2b3/gcc
intel_mpi/2013sp1           termcap/1.3.1/default
intel_mpi/xe2015            texinfo/5.2/default  
      

Note that some packages may be marked with (default) at the end which means that they are the default version of that type. For example if there is a package blah/pqr/xyz(default) and one named blah/pqr/abc then the former will be loaded if the command module load blah/pqr is issued.

Issuing the command module avail blah restricts the display of information to that regarding blah.

The package naming convention is package/version/flavour where package is the main package name, version is the version number and flavour reflects things such as compiler used, additional libraries linked with and other factors that may require a different version. Some system libraries omit the flavour qualifier.

Show Module Information

module whatis intel_compilers/2013sp1

 
intel_compilers/2013sp1: loads the intel_compilers (icc, ifort) 2013sp1 environment for x86_64
      

Loading Modules

module load intel_compilers/2013sp1

  
    This set PATH, LD_LIBRARY_PATH, LIBRARY_PATH, NLSPATH, MANPATH and INTEL_LICENSE_FILE
      

You may find that a module loads other modules that it depends on. Alternatively, a module may fail to load because it has a prerequisite and you must load that module first and then retry the one you wanted.

Alternatively you may find that a currently loaded module conflicts with one you attempt to load. E.g. if you have one version of OpenFoam loaded you cannot load another until you unload the first. See how to unload modules below.

If multiple versions of a package exist then the lexically last package is loaded unless a default is indicated. For example, if there are packages blah/abc and blah/def then module load blah will load blah/def unless blah/abc is set as the default for blah by the system administration team.

Note that modules print some information to the standard error stream about what they have done (which got loaded, changes to environment variables). This may mean that job output includes an error file even though it has been successful. This is done so that if you do have a job that has failed you can see what the module load command did for debugging purposes.

Verify Currently Loaded Modules

module list

Currently Loaded Modulefiles:
1) oscar-modules/1.0.3       2) intel_compilers/2013sp1
      

Unloading Modules

module unload intel_compilers/2013sp1

intel_compilers 2013sp1 has been unloaded
      

Unloading all modules

module purge