Software Modules — RCG Handbook

Software Modules

The Environment Modules package provides for the dynamic modification of a user’s environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the module command which interprets modulefiles. Typically modulefiles instruct the module command to alter or set shell environment variables such as PATH, MANPATH, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles.

Modules can be loaded and unloaded dynamically and atomically, in an clean fashion. All popular shells are supported, including bash, ksh, zsh, sh, csh, tcsh, as well as some scripting languages such as perl. Modules are useful in managing different versions of applications. Modules can also be bundled into metamodules that will load an entire suite of different applications.

Modules Quick Start

Here is an example of listing available modules on a FASNET GNU/Linux machine.

% module avail
--------------------------------- /rcg/software/Linux/RHEL/6/x86_64/modulefiles ----------------------------------
COMPILER/GNU/4.5.1            LIB/LIBEVENT/2.0.22           TOOLS/CUFFLINKS/2.2.1
COMPILER/GNU/4.8.2            LIB/OPENCV/2.4.10-CUDA65      TOOLS/ECLIPSE/4.4.1-CDT
COMPILER/GNU/4.9.0            LIB/OPENCV/2.4.9              TOOLS/EMACS/24.5
COMPILER/GNU/4.9.1            LIB/OPENCV/2.4.9-NOCUDA       TOOLS/EQUIBEL/20150626
COMPILER/GNU/4.9.2            LIB/OPENCV/3.0.0-CUDA65       TOOLS/GATK/3.2.2
COMPILER/GNU/5.1.0            LIB/QT/4.8.6                  TOOLS/GMAP/20141228
ENVIRONMENTS/CS               natlang                       TOOLS/IPE/7.1.3
ENVIRONMENTS/ENSC             TOOLS/ABYSS/1.5.2             TOOLS/JAGS/3.4.0
ENVIRONMENTS/Env.commit       TOOLS/AUTOCONF/2.69           TOOLS/JENA/2.12.1
ENVIRONMENTS/RCG              TOOLS/BEAST/1.7.4             TOOLS/MERLIN/1.1.2
LANG/MONO/3.12.1              TOOLS/BEAST/1.7.5             TOOLS/MRBAYES/3.2.1
LANG/PERL/5.22                TOOLS/BEDTOOLS/2.20.1         TOOLS/MRBAYES/3.2.2
LANG/PYTHON/2.7.10-GCC492     TOOLS/BIOAWK/2011             TOOLS/NEPIDEMIX/20140618
LANG/PYTHON/2.7.6-SYSTEM      TOOLS/BISON/3.0.2             TOOLS/NS-2/2.35
LANG/PYTHON/3.4.2-SYSTEM      TOOLS/BLAST/2.2.25            TOOLS/POPPLER/0.32
LANG/PYTHON/CAFFE             TOOLS/BLAT/36                 TOOLS/RCNN/20150427
LANG/R/2.15.3                 TOOLS/BOWTIE2/2.2.5           TOOLS/RSTUDIO/0.98.944
LANG/R/3.0.2                  TOOLS/BWA/0.7.10              TOOLS/SAGE/6.5
LANG/R/3.1.2                  TOOLS/CAFFE/20140710          TOOLS/SAMTOOLS/1.0
LANG/R/3.2.0                  TOOLS/CAFFE/20150213          TOOLS/SAMTOOLS/20140728
LANG/SWI-PROLOG/20150126      TOOLS/CAFFE/20150427          TOOLS/TIGERVNC/1.4.2
LIB/BEAGLE/20140529           TOOLS/CAFFE/20150623          TOOLS/TMUX/1.8
LIB/BOOST/1.55.0              TOOLS/CAFFE-FASTRCNN/20150623 TOOLS/TMUX/1.9a
LIB/BOOST/1.57.0              TOOLS/CLAVIS/1.1.1            TOOLS/TMUX/2.0
LIB/GLOG/0.3.3                TOOLS/CMAKE/2.8.12            TOOLS/TOPHAT/2.0.12
LIB/HDF5/1.8.12               TOOLS/CPLEX/12.5              TOOLS/TRANSABYSS/1.5.2
LIB/HDF5/1.8.14               TOOLS/CUDA/6.0                TOOLS/TRINITY/20140717
LIB/LEVELDB/20150213          TOOLS/CUDA/6.5                TOOLS/UVIC_ESCM/2.9
LIB/LIBEVENT/2.0.21           TOOLS/CUDA/7.0

Here is an example of loading a module

% module load COMPILERS/GNU/4.4.1
% which gcc

Now we’ll switch to a different version of the module

% module switch COMPILERS/GNU/4.4.2
% which gcc

And now we’ll unload the module altogether

% module unload gcc
% which gcc

Using Modules within cluster scripts

#PBS -W group_list=colony-users
#PBS -l nodes=1:ppn=1,pmem=1g,walltime=1:00:00

### Do something