Environment Modules on Biowulf & Helix

Helix and Biowulf now use environment modules to dynamically set up environments for different applications. Users can type commands like:

module load ThisApp
module unload ThisApp

to set up the environment for a particular application. The 'module load' command will set PATH, LD_LIBRARY_PATH and other environment variables as necessary. Any previous environment setups in your .bashrc or .cshrc files will continue to work, but modules are generally easier to use.

The Biowulf application pages have been updated to describe the modules command for each application. On 4 June 2018, Helix transition to an 'interactive data transfer node' and a limited number of apps related to data transfer are available on Helix. This page contains some general information about modules.

We use the Lmod Environment Modules system, developed at the TACC.

Video Tutorial

What modules are available?

The command module overview will show all available modules and the number of versions for each.

[biowulf ~]$ module overview
----------------------------------------- /usr/local/lmod/modulefiles ------------------------------------------
3DSlicer                 (3)    kraken                              (3)
ANNOgesic                (2)    krakenuniq                          (1)
ANTs                     (8)    kronatools                          (1)
AR-Decon                 (1)    lammps                              (2)
Accurity                 (1)    last                                (10)
AmpliconSuite-Pipeline   (2)    lastz                               (1)
AmpliconSuite            (1)    laynii                              (5)
Autodock-GPU             (2)    lazygit                             (1)
Autodock                 (2)    lbzip2                              (1)
AutodockCrankprep        (2)    ldsc                                (1)
AutodockVina             (2)    lefse                               (2)
B-SOID                   (1)    libevent/2.1.12                     (7)
BEAST                    (5)    libfreetype                         (14)
BGEN                     (1)    libjpeg-turbo                       (2)
BW                       (2)    libpng                              (2)
Beagle                   (7)    libpoppler                          (1)
BindCraft                (2)    libreoffice                         (1)
BioBERT                  (1)    libtiff                             (9)
[...etc...]

Each module is associated with one or more categories. On Biowulf, we assign categories mostly based on EDAM ontologies annotated by bio.tools. module category will show you all the available categories for which a module exists:

[biowulf ~]$ module category
---------------------------------------------- List of Categories ----------------------------------------------
Agricultural science                                 Medical informatics
Algorithms                                           Medicine
Allergy; clinical immunology and immunotherapeutics  Membrane and lipoproteins
Animal study                                         Metabolomics
Antigens                                             Metagenomic sequencing
Applied mathematics                                  Metagenomics
Assembly                                             Metatranscriptomics
Biobank                                              Microarray experiment
Bioinformatics                                       Microbial ecology
Biological databases                                 Microbiology
Biological rhythms                                   Mobile genetic elements
Biology                                              Model organisms
Biophysics                                           Molecular biology
Biotechnology                                        Molecular dynamics
Cardiology                                           Molecular genetics
Cell biology                                         Molecular interactions; pathways and networks
ChIP-on-chip                                         Molecular modeling
ChIP-seq                                             NMR
[..etc...]

To see all the modules in a particular category, do module category categoryname. e.g.,

[biowulf ~]$ module category "gene expression"

----------------------------------------------- Gene expression ------------------------------------------------
GEMMA        (2)   cellbender (2)   gsea     (3)   qtltools (1)   scanpy  (9)   tex       (2)   trust4 (1)
TransDecoder (1)   clinsv     (1)   impute   (1)   salmon   (6)   scvelo  (2)   theta     (1)
VIRTUS       (1)   express    (1)   kallisto (5)   samplot  (1)   slapnap (1)   trinity   (4)
ceas         (1)   gemma      (2)   magma    (1)   saturn   (1)   spark   (1)   trinotate (1)
  

To see the versions available for a particular application, use module avail appname. e.g.

[biowulf ~]$ module avail gromacs

---------- /usr/local/lmod/modulefiles -----------
gromacs/4.0.4          gromacs/4.5.1          gromacs/4.5.5(default)
gromacs/4.0.7          gromacs/4.5.3          gromacs/4.6-dev

This command, along with other search commands (spider, list) supports the use of regular expressions. This can be helpful for packages with difficult-to-search names, such as R:

[biowulf ~]$ module -r avail '^R$'

------------------------- /usr/local/lmod/modulefiles --------------------------
   R/Rdev_gcc-4.9.1     R/3.3.0_gcc-4.7.4    R/3.4.0_gcc-4.9.1     (D)
   R/Rdev_gcc-6.2.0     R/3.3.0_gcc-4.9.1    R/3.4.0_gcc-6.2.0
   R/2.14_gcc-4.4.7     R/3.3.1_gcc-4.9.1    R/3.4.3_gcc-4.9.1
   R/3.2.3_gcc-4.9.1    R/3.3.1_gcc-6.2.0    R/3.5.0beta_gcc-4.9.1
   R/3.2.5_gcc-4.9.1    R/3.3.2_gcc-4.9.1

  Where:
   (D):  Default Module

Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".

Modules have descriptions that you can read with module whatis appname and reference links you can see with module help appname:

[biowulf ~]$ module whatis gromacs
gromacs/2026.3-intel2024                          : Name: gromacs
gromacs/2026.3-intel2024                          : Description: Gromacs  is a versatile package to perform molecular dynamics, i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles. It is primarily designed for biochemical molecules like proteins and lipids that have a lot of complicated bonded interactions, but since GROMACS is extremely fast at calculating the nonbonded interactions (that usually dominate simulations) many groups are also using it for research on non-biological systems, e.g. polymers.
gromacs/2026.3-intel2024                          : URL: ftp://ftp.gromacs.org/pub/gromacs/
gromacs/2026.3-intel2024                          : Category: Molecular dynamics, Computational chemistry

[biowulf ~]$ module help gromacs

----------------------------- Module Specific Help for "gromacs/2026.3-intel2024" ------------------------------
See https://hpc.nih.gov/apps/Gromacs.html for usage information.

A very useful command is module keyword, which will show any modules whose name or description includes your search terms. e.g.

[biowulf ~]$ module keyword clustering

The following modules match your search criteria: "clustering"
-------------------------------------------------------------------------------------------------------------

  MCL: MCL/14-137
    MCL implements Markov cluster algorithm. Among its applications is the assignment of proteins into
    families based on precomputed sequence similarity information. This approach does not suffer from the
    problems that normally hinder other protein sequence clustering algorithms, such as the presence of
    multi-domain proteins, promiscuous domains and fragmented proteins.

  R: R/4.0, R/4.0.5, R/4.1, R/4.1.3, R/4.2, R/4.2.1, R/4.2.2, R/4.3, R/4.3.2, R/4.4, R/4.4.1, R/4.4.2, ...
    R (the R Project) is a language and environment for statistical computing and graphics. R is similar to
    S, and provides a wide variety of statistical and graphical techniques (linear and nonlinear modelling,
    statistical tests, time series analysis, classification, clustering, ...).

  bartender: bartender/1.1
    Bartender is an accurate clustering algorithm to detect barcodes and their abundances from raw
    next-generation sequencing data. In contrast with existing methods that cluster based on sequence
    similarity alone, Bartender uses a modified two-sample proportion test that also considers cluster size.
    This modification results in higher accuracy and lower rates of under- and over-clustering artifacts.

  bbtools: bbtools/38.96, bbtools/39.06
    An extensive set of bioinformatics tools including bbmap (short read aligner), bbnorm (kmer based
    normalization), dedupe (deduplication and clustering of unaligned reads), reformat (formatting and
    trimming reads) and many more.
[...etc...]
  

Another search command is module spider, which will run a case-insensitive search for any module whose name includes that word. e.g.

[biowulf ~]$ module spider bed
--------------------------------------------------
  bedops: bedops/2.4.3
-------------------------------------------------
    This module can be loaded directly: module load bedops/2.4.3


-------------------------------------------------
  bedtools:
-------------------------------------------------
     Versions:
        bedtools/2.21.1
        bedtools/2.22.0

-------------------------------------------------
  To find detailed information about bedtools please enter the full name.
  For example:

     $ module spider bedtools/2.22.0
------------------------------------------------

Load a Module

To load a module, use the command module load appname. The default version will get loaded. If you want a particular version, use module load appname/version e.g

[biowulf ~]$ module list
No Modulefiles Currently Loaded.

[biowulf ~]$ module load gromacs

[biowulf ~]$ module list
Currently Loaded Modules:
  1) gromacs/4.5.5
[biowulf ~]$ module load gromacs/4.5.3

[biowulf ~]$ module list
Currently Loaded Modules:
  1) gromacs/4.5.3

Multiple modules can be loaded in a single command. e.g.

[biowulf ~]$ module load plinkseq macs bowtie

[biowulf ~]$ module list
Currently Loaded Modules:
  1) plinkseq/0.08    2) macs/2.0.10      3) bowtie/2-2.0.2

Unload a Module

To unload a module, use the command module unload Appname. e.g.

[biowulf ~]$ module list
Currently Loaded Modules:
  1) gromacs/4.5.3
[biowulf ~]$ module unload gromacs/4.5.3

See what modules have been loaded

The command module list will show what modules have been loaded.

[biowulf ~]$ module list
Currently Loaded Modules:
  1) qiime        2) perl/5.8.9

Switch to a different version of an application

The command module switch appname appname/version will switch from one version of an application to another. .

[biowulf ~]$ module list
Currently Loaded Modules:
  1) perl/5.8.9
[biowulf ~]$ module switch perl perl/5.12.1
[biowulf ~]$ module list
Currently Loaded Modules:
  1) perl/5.12.1

If you load a module, then load another version of the same module, the first one will be unloaded. For example:

[biowulf ~]$ module load fcgene
[biowulf ~]$ module list

Currently Loaded Modules:
  1) fcgene/1.0.7

[biowulf ~]$ module load fcgene/1.0.6

The following have been reloaded with a version change:
  1) fcgene/1.0.7 => fcgene/1.0.6

[biowulf ~]$ module list

Currently Loaded Modules:
  1) fcgene/1.0.6

Examine a modulefile

If you want to see what changes a module will make to your environment without loading it, use the 'module display' command. e.g.

[user@biowulf] module display meme

----------------------------------------------------------------------------------------------
   /usr/local/lmod/modulefiles/meme/4.10.0:
---------------------------------------------------------------------------------------------
whatis("Sets up MEME 4.10.0 - MPI version ")
prepend_path("PATH","/usr/local/OpenMPI/1.8.1/gnu/eth/bin")
prepend_path("LD_LIBRARY_PATH","/usr/local/OpenMPI/1.8.1/gnu/eth/lib")
prepend_path("PATH","/usr/local/apps/meme/4.10.0/bin")

The output is in the lua programming language, but is usually easily understandable. For a table of lua-tcl-bash equivalents, see this page.

If you prefer to set paths directly instead of using modules, you can use the information from "module display" to do so.

Set up personal modulefiles

Create a directory called "modulefiles" in your home directory. Then type the command: "module use --append ~/modulefiles" and any personal module files in this directory will become available for you to list, load or unload. You can make copies of the system modulefiles in "/usr/local/lmod/modulefiles" to use as templates.

[biowulf ~]$ module use --append ~/modulefiles

[biowulf ~]$ module avail

---------- /usr/local/lmod/modulefiles -----------
afni/18Oct2012(default) cuda/3.1                modules                 namd/2.9-ipath
afni/18Oct2012-openmp   cuda/4.0.17             mpich2-x86_64           null
afni/21Dec2011          dot                     namd/2.7+plumed1.3      perl/5.12.1
[...etc...]

---------- /home/user/modulefiles ----------
hmmer/2.3


As you see above, after adding '~/modulefiles' to the module path, your private modules are now displayed. If a personal module has the same name as a system module, the system module will have priority. You can also use module use --prepend ~/modulefiles to give your personal modules priority over system modules.

Using modules in scripts

The 'module' command can be used in any batch script or other script. A typical script on the Biowulf login node would be

#!/bin/bash

module load somemodule
somecommands

Please note that, if your login shell is bash and you would like to submit a job using a script written in tcsh, incompatibilities between bash and tcsh will prevent the export of parts of your environment, such as defined functions. This means that the module command will not work automatically. To get around this, you should load the module setup script for csh as part of your submission script:

#!/bin/tcsh

source /etc/profile.d/modules.csh
module load somemodule
somecommands

A typical Biowulf batch script to be submitted to the Biowulf batch system would be:

#!/bin/bash

module load afni
[...some afni command...]

Likewise, Biowulf swarm jobs could either include the module command in each line, or be submitted with --module somemodule. See the Biowulf swarm page for more information.

Working with Modules within Perl and Python, at the NERSC site.

For information about Nested Modules (a modulefile that loads and unloads other modules), see this page

Shared Modules

To set up modules that will be shared by a group, the easiest way is to create a 'modulefiles' directory in some area that is shared by the group, and put the group modules into that directory. Each user in the group who wants to access these modules can then create a link from the shared area to their own /home/user/modulefiles/ area. For example, suppose the group has a shared area called /data/DBCImaging.

biowulf% mkdir /data/DBCImaging/modulefiles
Create the desired modulefiles in this directory. If a personal/group module has the same name as a system module, the system module will get lower priority, and your personal module will be loaded first.

Now each user in the group who wants to use these shared modules should create a link from their /home/user/modulefiles area.

biowulf% ln -s /data/DCBImaging/modulefiles /home/user/modulefiles/shared
biowulf% module load use.own
biowulf% module avail

----------------------- /home/user/modulefiles -------------------------------
blast                       shared/bowtie/0.12.8        shared/bowtie/2-2.0.6
freesurfer/5.1              shared/bowtie/0.12.9        shared/bowtie/2-2.1.0
myngs                       shared/bowtie/2-2.0.0-beta7 shared/octave_test/3.2.4
nested                      shared/bowtie/2-2.0.2       shared/octave_test/3.6.1
shared/bowtie/0.12.5        shared/bowtie/2-2.0.5       susantest

---------------------------- /usr/local/lmod/modulefiles ---------------
BEAST/1.5.2                    eman2/2.06                     openmpi/1.6/gnu/eth
BEAST/1.5.4                    eman2/2.06_121120              openmpi/1.6/gnu/ib
BEAST/1.6.1                    eman2/2.06_ib                  openmpi/1.6/gnu/ipath
BEAST/1.6.2                    express/1.2.2                  openmpi/1.6/intel/eth
BEAST/1.7.1                    express/1.3.1(default)         openmpi/1.6/intel/ib
[...]

biowulf% module load shared/octave_test/3.2.4

biowulf% module list
Currently Loaded Modules:
  1) use.own                    2) shared/octave_test/3.6.1

Users who do not have access to the shared area (in this case /data/DBCImaging) will not be able to see the shared modules.

Output from Modules

Most modules will silently set up paths and environments. Some modules need to set up additional dependencies apart from the main program (e.g. a scientific program that requires a particular version of Python will load that Python version into your path as well), and in that case, we have set up the module to print the additional dependencies that are being loaded. For example:

[biowulf ~]$ module load sratoolkit
java/1.7.0 is loaded

These messages are useful for interactive use, but may be annoying or problematic when running large-scale batch jobs. In that case, to get rid of the messages, you should use 'module -q load' (-q = quiet)

#!/bin/bash

module -q load somemodule

program [options] [arguments]....

Documentation

Lmod: A new environment module system