Module Software

The Module package provides for the dynamic modification of a users's environment via module files. Module files manage necessary changes to the environment, such as adding to the default path or defining environment variables, so that you do not have to manage those definitions and paths manually.  

Modules are also used to manage multiple versions of applications, tools, and libraries, and where name conflicts between multiple packages would cause problems.

Modules have been created for most of the software packages installed on PSC systems.  Type module available to see a complete list of the modules available on that system. 

Basic use

To see what modules are available for a software package, type

module avail package-name

To set up the environment for a software package, load that environment with the module load command.

module load package-name

Module commands

Some useful module commands are:

module avail lists all the available modules
module avail foo lists all the available modules for package foo
module help foo displays help on module foo
module display foo indicates what changes would be made to the environment by loading module foo without actually loading it
module load foo loads module foo
module list displays your currently loaded modules
module swap foo1 foo2 switches loaded module foo1 with module foo2
module unload foo reverses all changes to the environment made by previously loading module foo
  

 

Software dependencies

Sometimes a package requires  supporting software in order to run successfully.  This is especially true for bioinformatics software.  In such cases, all the relevant modules must be loaded or the job can fail. 

To help with this, module files have been created which load everything a given package is dependent on.  These module files have "-all" appended to the name.  One example of this is the Cufflinks package.  Modules defined for Cufflinks are:

$ module avail cufflinks
------------------------------ /opt/modulefiles/7 ------------------------------
cufflinks/2.2.1     cufflinks/2.2.1-all

Typing module help module-name shows which additional modules will be loaded, along with other help:

$ module help cufflinks/2.2.1-all
----------- Module Specific Help for 'cufflinks/2.2.1-all' --------
Cufflinks  2.2.1-all (Cufflinks)
---------------------------------
 This module loads the following modules:
        boost/1.50.0
        gcc/4.8.4
        gcc/4.9.2
        samtools/0.1.19
        cufflinks/2.2.1
 To get help with the program's usage enter:  cufflinks

 

In some cases, you may want to use a different version of supporting software than the "-all" module uses.  If so, you can use the "regular" module and manually load the supporting modules (here, boost, gcc and samtools) yourself.  Using module help provides information about which supporting modules are required for a package.

$ module help cufflinks/2.2.1
----------- Module Specific Help for 'cufflinks/2.2.1' ------------
Cufflinks  2.2.1 (Cufflinks)
-----------------------
 To enable, first load the following required modules (via module load command):
        boost/1.50.0
        gcc/4.8.4
        gcc/4.9.1
        samtools/0.1.19
        cufflinks/2.2.1
 Then to get help with the program's usage enter:  cufflinks

 

Multiple versions of software

Often multiple versions of a given software package are installed.   You must load the module for the specific version that you want.  To  see what versions are available, use the module available command.

module availabile package-name

This example shows that several versions of TAU are installed, from 2.19 to 2.23.1:

tg-login1:~> module avail tau
-------------------------- /usr/local/opt/modulefiles --------------------------
tau/2.19         tau/2.20.2        tau/2.23
tau/2.19.2        tau/2.20.3        tau/2.23.1
tau/2.20          tau/2.21(default)

To see which is the default version, type

module show package-name

Here, for example, you can see that  2.21 is the default version of TAU

tg-login1:~> module show tau
-------------------------------------------------------------------
/usr/local/opt/modulefiles/tau/2.21:
module           load java
setenv           TAU_ROOT_DIR /usr/local/packages/TAU/usr/2.21
setenv           TAU_MAKEFILE /usr/local/packages/TAU/usr/2.21/x86_64/lib/Makefile.tau-icpc-mpi-pdt
setenv           JAVA_ROOT_DIR /usr/java/jdk1.6.0_21/jre/bin
prepend-path     PATH /usr/local/packages/TAU/usr/2.21/x86_64/bin
prepend-path     PATH /usr/local/packages/TAU/usr/2.21
prepend-path     PATH /usr/java/jdk1.6.0_21/jre/bin
prepend-path     MANPATH /usr/local/packages/TAU/usr/2.21/man
-------------------------------------------------------------------

To load the default version, just type

module load package-name

so typing

module load tau

loads version 2.21, in this example.

To load a different version, use the specific module name. For example, to load TAU version 2.19 instead of the default, type

module load tau/2.19

Conflicts

Modules for different packages or different versions of the same package can sometimes interfere with each other. To ensure that you have the environment that you expect, you should always check which modules are loaded and use the unload command to remove any that you don't need before using load for the ones you want, or use swap to switch modules.

Examples

The module load command loads a specific module. For example, the command

module load icc/10.1.015

sets the proper definitions for you to use version 10.1.015 of the icc compiler. When you are done with a module you can unload it and undo its effect.

module unload icc/10.1.015

Or you can swap it with another module if you want to use a different version of the same software.

module swap icc/10.1.015 icc/10.1.017

After you issue this command, when you run the icc compiler you will be using version 10.1.017 of the compiler, not version 10.1.015.