You are here

Modules

We have implemented the modules software package to manage nearly all software installed in Minerva and the associated user environment. Modules provide an easy mechanism for updating a user's environment especially the PATH, MANPATH, NLSPATH, and LD_LIBRARY_PATH environment variables to name a few. The distinct advantage of the modules approach is that the user is no longer required to explicitly specify paths for different software versions nor need to try to keep the related environment variables coordinated. With the modules approach, users simply "load" and "unload" modules to control their environment.

Module Command

The module avail command lists all the modules available to be loaded.

$ module avail
-------------- /packages/Modules/3.2.9/modulefiles -------------------


dot         module-cvs        module-info    modules    null     use.own


-------------- /packages/modulefiles/ --------------------------------
EMAN2/2.04           gatk/1.5-21-g979a84a     plinkseq/0.08
MACS/1.4.2           gcc/4.1.2                protobuf/2.4.1-gcc
R/2.15.0             gcc/4.6.3(default)       python/2.6.7
Xmipp/2.4            gcc/4.7.0                python/2.7.2(default)
... 


To have a module loaded to your current environment:

$ module load modulefile

The following command adds one or more modules to your current session.

$ module load [modulefile1] [modulefile2]

To remove a module from your current environment:

$ module unload modulefile

To remove all the modules from your current environment:

$ module purge

The following command demonstrates the true advantage of using modules. Different versions of entire software packages can be replaced with a single module command:

$ module switch [modulefile_old] [modulefile_new]

And the module list command will list all the modules which are currently loaded in your environment.

$ module list
Currently Loaded Modulefiles:
  1) modules
  2) 3.2.9
  3) /gcc/4.6.3(default)
  4) /openmpi/1.4.5-gcc-torque(default)
  5) /python/2.7.2(default)
  6) /numpy/1.6.1-python2.7.2(default)
  7) /java/1.7.0_03(default)


To get a usage list of module options type the following (the listing has been abbreviated to only those commands discussed in this webpage):

$ module help
  Modules Release 3.2.9 2011-11-24 (Copyright GNU GPL v2 1991):
  Usage: module [ switches ] [ subcommand ] [subcommand-args ]
  Available SubCommands and Args:
        + add|load                 modulefile [modulefile ...]
        + rm|unload                modulefile [modulefile ...]
        + switch|swap              [modulefile1] modulefile2
        + display|show             modulefile [modulefile ...]
        + avail                    [modulefile [modulefile ...]]
        + list
        + help                     [modulefile [modulefile ...]]

To get more information about a specific module use the module help command to display the “help” information contained within the given module file.

$ module help r/2.12.2
----------- Module Specific Help for 'r/2.12.2' -------------------
        r/2.12.2 module
        ****************************************************
          This module sets up the following environment
          variables for R
              PATH
          Version 3.2.7
        ****************************************************


The module show command allows you to see exactly what a given “modulefile” will do to your environment, such as what will be added to the PATH, MANPATH, etc. environment variables:

$ module show tophat
-------------------------------------------------------------------
/packages/modulefiles//tophat/2.0.0:

module-whatis	 2.0.0 
prepend-path	 PATH /packages/tophat/2.0.0/bin 
setenv TOPHAT2_HOME /packages/tophat/2.0.0 
-------------------------------------------------------------------


At times one module will conflict with another. In that event you will receive an error and will need to remove the conflicting module yourself before being able to proceed. To load a specific version, load the module using its full specification. An example showing this follows:

$ module load gcc/4.6.3
$ module load gcc/4.7.0
gcc/4.7.0(7):ERROR:150: Module 'gcc/4.7.0' conflicts with the currently loaded module(s) 'gcc/4.6.3'
gcc/4.7.0(7):ERROR:102: Tcl command execution failed: conflict gcc

Setting Up Your Own Modules
You can point the module command to your own modulefiles using the “module use
” command. This command updates the environment variable MODULEPATH, which defines where modulefiles are to be found. Documentation on preparing modulefiles can be found online (http://modules.sourceforge.net/man/modulefile.html), but feel free to poke around our modulefiles for some examples. They live in /hpc/packages/minerva-XYZ/modulefiles, where XYZ is either “manda”, “mothra”, or “common”.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer