Compute server > Concept of operations > Work environment

Work environment: Modules

Introduction

The Modules software package is installed on the RRZN cluster system (except for Zen) and is a way for a user to easily modify their working environment to provide access to the wide range of software packages made available on the cluster system (e.g. CAE programs, compilers etc.).  The software is basically a set of special commands and definitions files (module files) which descript which particular operations should be performed.  For example, to extend the environment variables PATH, LD_LIBRARY_PATH etc.)

The use of the modules software is by default active.

Module commands

The command is:

module

Further options are obtained like this:

$ module help   

  Modules Release 3.2.5 2007-02-14 (Copyright GNU GPL v2 1991):

  Usage: module [ switches ] [ subcommand ] [subcommand-args ]

Switches:
        -H|--help               this usage info
       ......
  Available SubCommands and Args:
        + add|load              modulefile [modulefile ...]
        + rm|unload             modulefile [modulefile ...]
        + switch|swap           [modulefile1] modulefile2
        + display|show          modulefile [modulefile ...]
        + avail                 [modulefile [modulefile ...]]
        + use [-a|--append]     dir [dir ...]
        + list
        + help                  [modulefile [modulefile ...]]
        + whatis                [modulefile [modulefile ...]]

The output from module help given here is not the complete listing.  There is also a manual page which is avaiable via this command: man module

module avail

This lists all available modules.

module list

This lists all currently loaded modules.

module show <name of modulefile>

This shows the values of the environment variables which will be set if the module were to be loaded.

module load <name of modulefile>

This loads a specific module into the working environment.

module unload <name of modulefile>

This unloads the given module and unsets the relevant environment variables.

Example (on Orac)

$ module list       
No Modulefiles Currently Loaded.

$ module avail      

------------------ /usr/share/Modules/modulefiles -------------------
dot         module-info null
module-cvs  modules     use.own

-------------------------- /sw/modulefiles --------------------------
abaqus/674               mathematica/6.0
abaqus/681(default)      matlab
ansys/11.0(default)      nagcl
ansys/110                nagf95
cfx/11.0(default)        nagfl90
comsol/3.3               ncl/5.0.0-gcc(default)
fluent                   numpy/1.1.0
g03                      patran
gams/227                 pgi/5.2
hfss                     pgi/6.2
icc/10.1.015(default)    pgi/7.2(default)
ict/3.1.1(default)       pgi-mpich/7.2(default)
idb/10.1.015(default)    povray/3.6
ifort/10.1.015(default)  starcd/4.06(default)
imkl/10.0.3.020(default) totalview/8.2.0(default)
impi/3.1(default)        totalview/8.5.0
itac/7.1(default)        vtk/5.0
marc/2007

$ module show ifort 
-------------------------------------------------------------------
/sw/modulefiles/ifort/10.1.015:
module-whatis    Intel Fortran compiler Version 10.1.015
prepend-path     PATH /sw/tools/intel/fce/10.1.015/bin
prepend-path     LD_LIBRARY_PATH /sw/tools/intel/fce/10.1.015/lib
prepend-path     LD_RUN_PATH /sw/tools/intel/fce/10.1.015/lib
prepend-path     MANPATH /sw/tools/intel/fce/10.1.015/man
setenv           INTEL_LICENSE_FILE 28518@licserv.rrzn.uni-hannover.de
-------------------------------------------------------------------
$ module load ifort
$ echo $PATH
/sw/tools/intel/fce/10.1.015/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:.

Modules and versions

There can be more than one version of a particular software package.  This can also be seen in the modules environment.  In the following example two versions of the PGI compiler toolkit are loaded.

module load pgi

loads the default version of the PGI compiler suite (in this case, version 7.2).  If one wants another version, say 6.2, one has to enter the following:

module load pgi/6.2

Using Modules in the batch system

Within batch jobs and shell scripts one needs to ensure that the module software package is properly initialised (see also the examples for batch jobs):

. $MODULESHOME/init/ksh

if one uses the Korn shell, or

. $MODULESHOME/init/bash

of one uses the Bash shell. The environment variable MODULESHOME is set by the system at login.

Quicklink

The source code of the Modules software package and further documentation is available from SourceForge.

Last Change: 27.09.2012
 
Editorial Responsibility Dr Paul Cochrane