What are Environment Modules?

Introduction

 

 

 

  • The environment modules package is a tool that allows you to quickly and easily modify your shell environment to access different software packages.
  • Research Computing offers a large (and growing) number of software packages to users, and each package may contain several tools, manual pages and libraries, or it may require special setup to work properly.
  • Some software packages come in several versions or flavors, many of which conflict with each other.
  • Modules allow you to tailor your shell to access exactly the packages you need by setting up the relevant environment variables for you, and automatically avoiding many possible conflicts between packages.

 

 

 

 

Useful Commands

Command

Used For

module avail

List available modules

module load

Load module named

module unload

Unload module named

module whatis

Give description of module

module list

List modules that are loaded in your environment

module purge

Unload all currently loaded modules from your environment

module display

Give the rules for module


Sample Execution

  • module avail
[user@cph-i2 ~]$ module avail    
-------------------------/usr/share/Modules/modulefiles-------------------------------    
dot         module-git  module-info modules     null        use.own    
     
---------------- /apps/usr/slurm/modules/compilers -----------------------------------    
     

anaconda2/2019.07

anaconda3/2019.07-cuda10 bazel/0.25.2(default) go/1.14.2
lua/5.3.5 pymods/2.7.5 anaconda2/2019.07-cuda10
anaconda3/5.0.1(default) gcc/6.4.0 intel/14.0.3
openjdk/11 pypy/5.3.1 anaconda2/5.0.1(default)
anaconda3/5.0.1-cuda92 gcc/7.3.0(default) intel/16.0.0
openjdk/13(default) scala/2.10.4(default) anaconda2/5.0.1-cuda92
bazel/0.21.0 gcc/8.2.0 intel/19.0.0(default)
perlmods/5.16.3 scala/2.11.7anaconda3/2019.07 bazel/0.22.0
ghc/7.10.3 julia/1.0.1 pgi/18.7
yasm/1.3.0    
------------------- /apps/usr/slurm/modules/apps ----------------------------------------------------------------    
abaqus/2017(default)                       hyperworks/2020                            pytorch/1.5.1-anaconda3-cuda10.2(default)    
abaqus/2020                                interproscan/5.44-79.0                     pytorch/1.6.0-anaconda3-cuda10.2    
abaqus/6.13-4                              interproscan/5.50-84.0(default)            qiime/1.9.1    
abyss/2.1.1                                iqtree/1.6.12                              qiime2/2018.8    
abyss/2.1.5(default)                       iqtree/2.1.2(default)                      qiime2/2019.1(default)    
abyss/2.2.5                                i-tasser/5.1                               qiime2/2020.2    
agwg-merge/180114                          itk/4.9.0                                  quast/5.0.2    
allennlp/0.8.3                             jags/4.3.0                                 R/3.5.0    
allpathslg/52488                           jcvi/0.8.12                                R/3.5.0-mpi    
ambertools/18(default)                     jellyfish/2.2.6                            R/3.6.0(default)    
ambertools/18-mpi                          kneaddata/0.7.2                            R/3.6.0-mpi    
angsd/0.918                                kraken/1.1                                 R/4.0.3    
angsd/0.930(default)                       kwip/0.2.0                                 R/4.0.3-mpi    
ansa/13.1.3                                lachesis/201701                            racon/1.3.1    
anvio/5.3                                  lammps/12Dec18-intel-gpu                   ragtag/1.0.2    
artic/1.2.1                                lammps/12Dec18-intel-mpi                   ragtag/1.1.1(default)    
atsas/3.0.3                                lammps/18Jun19-intel-gpu                   raxml/7.4.2    
augustus/3.3.2(default)                    lammps/18Jun19-intel-mpi(default)          raxml/7.4.2-mpi    
augustus/3.3.3                             lammps/29Oct20-intel-gpu                   raxml/8.2.12(default)    
augustus/3.4.0                             lammps/29Oct20-intel-mpi                   raxml/8.2.12-mpi    
bamtools/2.4.1                             lastz/1.04.00                              raxml/8.2.4    
bamtools/2.5.1                             liggghts/3.7.0                             raxml/8.2.4-mpi    
bbtools/38.76                              liggghts/3.8.0(default)                    remora/1.8.3    
bcftools/1.10                              links/1.8.7                                remora/1.8.3-ompi403    
bcftools/1.3.1                             lordec/0.8                                 repdenovo/0.0    
bcftools/1.6                               ls-dyna/10.1.0                             repeatmasker/4.0.8    
bcftools/1.9(default)                      ls-dyna/11.0.0(default)                    repeatmodeler/1.0.11    
beast/2.6.3                                ls-dyna/9.3.0                              repeatscout/1.0.5    
bedtools2/2.26.0                           mafft/7.055woe                             rmblast/2.6.0    
bedtools2/2.29.0(default)                  mafft/7.273woe(default)                    rosetta/2015.02    
bismark/0.18.0                             maker/2.31                                 rosetta/2016.10    
bismark/0.22.3(default)                    maker/2.31-mpi                             rosetta/2019.07(default)    
blasr/5.3                                  maker/3.01(default)                        rstudio/1.1    
blast/2.3.0+                               maker/3.01-mpi                             rstudio/1.2    
blast/2.5.0+(default)                      masurca/3.2.7                              rstudio/1.3(default)    
blast/2.9.0+                               masurca/3.3.4(default)                     samtools/1.10    
blatsuite/36                               masurca/4.0.1                              samtools/1.3.1    
bowtie2/2.2.9                              mathematica/11.2.0(default)                samtools/1.6    
bowtie2/2.4.1(default)                     mathematica/11.3.0                         samtools/1.9(default)    
braker/2.0.6                               mathematica/8.0                            sas/9.4    
braker/2.1.2(default)                      matlab/R2018b                              seer/1.1.1-intel    
braker/2.1.5                               matlab/R2019b(default)                     segnet/1.0.0    
busco/3.0.2(default)                       matlab/R2020b                              segnet/1.0.0-cuda8(default)    
busco/4.0.6                                mauve/2015.02                              segnet/1.0.0-cuda8-nodnn    
bwa/0.7.12                                 mcr/R2018a                                 seqkit/0.11.0    
bwa/0.7.17(default)                        mcr/R2018b(default)                        seqtk/1.2    
c2x/2.26b                                  mcr/R2019b                                 seqtk/1.3(default)    
caffe/1.0(default)                         meme/4.12.0                                shortbred/0.9.5    
caffe/1.0.0rc3                             meme/5.0.1(default)                        siesta/3.2    
caffe/1.0.0rc3-cuda8                       meme/5.0.5                                 siesta/4.0.2(default)    
caffe/1.0-cuda8                            meraculous/2.2.5                           slim/2.5    
canu/1.8                                   metabat/2.13                               smartie-sv/0.0    
cd-hit/4.8.1                               metaphlan/2.7.2                            smog/2.0.2    
cmake/3.10.2                               metaphlan/2.7.7(default)                   snp-pipeline/2.2.1    
cmake/3.12.3(default)                      methyldackel/0.2.1                         sowhat/0.36    
cna/2.0                                    minialign/0.4.4(default)                   spades/3.11.1    
cnvnator/0.3.3                             minialign/0.6.0                            spades/3.13.1(default)    
crossmap/0.2.9(default)                    miniasm/0.2                                spades/3.14.1    
crossmap/0.3.3                             minimap2/2.17(default)                     sqanti3/1.6    
cuda/10.0                                  minimap2/2.18                              sra-tools/2.10.5    
cuda/10.2                                  mirdeep2/0.1.2                             sra-tools/2.9.4(default)    
cuda/8.0                                   mirdp2/1.1.4                               stacks/1.4.7    
cuda/9.2(default)                          mir-prefer/0.24                            star/2.7.0c    
cufflinks/2.2.1                            moose-pkgs/1.0.0                           starccm/13.04    
cutadapt/1.15(default)                     mpiblast/1.6.0                             starccm/2019.3    
cutadapt/1.18                              mpp-dyna/10.2.0                            starccm/2020.2(default)    
ddocent/2.7.8                              mpp-dyna/11.0.0(default)                   stata/11    
diamond/2.0.9                              mpp-dyna/9.3.0                             subread/1.5.2    
drap/1.92                                  mrbayes/3.2.2                              tensorflow/1.14-anaconda3-cuda10.0    
eclipse/4.3.2                              mrbayes/3.2.7(default)                     tensorflow/2.0-anaconda3-cuda10.0(default)    
emboss/6.6.0                               muscle/3.8.31                              tensorflow/2.2-anaconda3-cuda10.2    
espresso/5.3-intel-mpi                     namd/2.11-mcore                            tophat/2.1.1    
espresso/6.3-intel-mpi(default)            namd/2.11-mpi(default)                     treemix/1.13    
examl/3.0.17                               namd/2.13-mcore                            trim_galore/0.4.4    
examl/3.0.21(default)                      namd/2.13-mcore-cuda                       trimmomatic/0.38    
exonerate/2.4.0                            namd/2.13-mpi                              trimmomatic/0.39(default)    
fastqc/0.11.5                              nasm/2.14                                  trinity/2.4.0    
fds/6.7.0                                  nco/4.4.8                                  trinity/2.8.5(default)    
fds/6.7.3(default)                         netbeans/8.0.2                             trinotate/3.2.2    
ffmpeg/2.8.13                              netbeans/8.1(default)                      tritex/2020-02    
ffmpeg/3.2.14                              netlogo/5.0.4                              valgrind/3.13.0    
ffmpeg/4.2.1(default)                      netlogo/5.1.0                              vcftools/0.1.15    
ffmpeg/4.2.1-cuda10                        netlogo/6.1.1(default)                     vcftools/0.1.16(default)    
firefox/58.0.2                             node.js/4.4.0                              velvet/1.2.10    
fmlrc/0.1.2                                openbabel/2.3.2                            vep/95.1    
freebayes/1.3.1                            openfoam/1906(default)                     viennarna/2.4.13    
gamess/00-intel                            openfoam/2012                              visit/2.10.3    
garli/0.942                                openfoam/7                                 visit/2.10.3-ib    
garli/0.942-mpi                            openfoam/8                                 visit/2.13.1    
garli/2.01(default)                        opensfm/0.2.0                              visit/2.13.1-ib(default)    
garli/2.01-mpi                             orca/4.2.1                                 vmd/1.9.3-cuda75-text-egl    
gatk/3.8.0                                 orp/2.2.8(default)                         vmd/1.9.3-cuda8-opengl(default)    
gatk/3.8.1                                 orp/2.3.1                                  vmd/1.9.3-text    
gatk/4.1.6(default)                        orthofinder/2.2.7                          vscode/1.33    
genemark/4.62                              orthofinder/2.4.0(default)                 vtk/6.2.0    
git/2.19.2                                 pacbio/2019.8                              vtk/7.0.0    
gromacs/2018                               pacbio/2021.2(default)                     vtk/7.0.0-mpi(default)    
gromacs/2018-cuda                          parallel/20190322(default)                 vtk/8.2.0    
gromacs/2018-mpi                           parallel/20200122                          vtk/8.2.0-mpi    
gromacs/2018-mpi-cuda                      paraview/5.0.0-mpi                         wengan/0.2    
gromacs/2019.3(default)                    paraview/5.7.1                             wham/2.0.9    
gromacs/2019.3-cuda                        paraview/5.7.1-mpi(default)                wise2/2.4.1    
gromacs/2019.3-mpi                         parcels/2.1.5                              wrf/3.9.1-intel-mpi    
gromacs/2019.3-mpi-cuda                    pbsuite/15.8.24                            wrf/3.9.1-intel-serial    
gromacs/2020.2                             pdl/2.015                                  wrf/4.0.1-intel-mpi(default)    
gromacs/2020.2-cuda                        peridigm/1.4.1-mpi(default)                wrf/4.0.1-intel-serial    
gromacs/2020.2-mpi                         peridigm/1.5.0-mpi                         wtdbg/2.3    
gromacs/2020.2-mpi-cuda                    picard/2.18.29(default)                    wtdbg/2.5(default)    
guppy/3.6.1(default)                       picard/2.9.2                               xcrysden/1.5.60    
guppy/3.6.1-cuda                           platanus/1.2.4                             xerces-c/3.2.1    
gurobi/8.1.1                               plink/1.90b3.32                            yade/2017.01a    
gurobi/9.1.1(default)                      plink/2.00a2LM(default)                    yade/2020.01a(default)    
hecaton/2020-02                            poy/5.0.1                                  yices/2.4.2    
hic-pro/2.11.1                             poy/5.1.2(default)                         yices/2.6.1(default)    
hisat2/2.2.0                               psmc/0.6.5                                 z3/4.4.1    
humann2/0.11.2                             pytorch/1.2.0-anaconda3-cuda10.0    
[user@cph-i2 ~]$    

 

  • module avail

(base) [user@cph-i1 ~]$ module avail anaconda

---------------- /apps/usr/slurm/modules/compilers -------------------------------------------------------------

anaconda2/2019.07        anaconda2/5.0.1(default) anaconda3/2019.07        anaconda3/5.0.1(default)

anaconda2/2019.07-cuda10 anaconda2/5.0.1-cuda92   anaconda3/2019.07-cuda10 anaconda3/5.0.1-cuda92

 

  • module display

(base) [user@cph-i1 ~]$ module display anaconda2/5.0.1

------------------------------------------------------------------------

/apps/usr/slurm/modules/compilers/anaconda2/5.0.1:

module-whatis    Anaconda (python 2.6-based) is the world’s most popular Python data science platform. Anaconda, Inc. continues to lead open source projects like Anaconda, NumPy and SciPy that form the foundation of modern data science. Load this module for CPU ONLY (NON-GPU) compute jobs.

conflict         anaconda2

conflict         anaconda3

setenv           ANACONDA /apps/pkg/anaconda2/5.0.1/rhel7_u5/gnu

prepend-path     PATH /apps/pkg/anaconda2/5.0.1/rhel7_u5/gnu/bin

prepend-path     LD_LIBRARY_PATH /apps/pkg/anaconda2/5.0.1/rhel7_u5/gnu/lib

prepend-path     MANPATH /apps/pkg/anaconda2/5.0.1/rhel7_u5/gnu/share/man:/apps/pkg/anaconda2/5.0.1/rhel7_u5/gnu/man

-------------------------------------------------------------------

  • module load anaconda3
  • module list

(base) [user@cph-i1 ~]$ module list

Currently Loaded Modulefiles:

  1) perlmods/5.16.3   2) anaconda3/5.0.1

 


How the Modules are Organized and Grouped

The modules are organized into “categories”, which include: /apps/usr/modules/mpi, compilers, apps, and /apps/sys/Modules/3.2.6/modulefiles. Under each category, you will see “groups” of applications: openmpi, intel, pgi, to name a few. Within each group, there may be several versions to choose from. The group and version are separated with a “slash” (/).

Default Modules

You probably noticed some modules listed above are suffixed with a “(default)”. The “default” module is the module that will get loaded if you do not specify a version number. For example, we can load the “intel/16.0.0” module by omitting the version number:

$ module load intel

$ module list

Currently Loaded Modulefiles:

  1)  intel/19.0.0

Note: If you plan to load a version of a module that is not the default, then you must specify the version in the module load command.


Conflicts and Prerequisites

Some modules conflict with others, and some modules are prerequisites of others. Environment Modules handles both scenarios.

The following is an example of trying to load a module that is dependent upon another:

 

$ module display gromacs/4.6.7-cuda

-------------------------------------------------------------------

/apps/usr/modules/apps/gromacs/4.6.7-cuda:

module-whatis 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, lipids and nucleic acids that have a lot of complicated bonded

interactions, but since GROMACS is extremely fast at calculating the nonbonded

interactions, many groups are also using it for research on non-biological

systems, e.g. polymers.

conflict gromacs

prereq cuda

setenv GROMACS /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda

setenv GMXBIN /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/bin

setenv GMXLDLIB /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/lib

setenv GMXDATA /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/share

setenv GMXMAN /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/share/man

setenv GMXLIB /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/share/gromacs/top

prepend-path PATH /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/bin

prepend-path MANPATH /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/share/man

prepend-path LD_LIBRARY_PATH /apps/pkg/gromacs-4.6.7/rhel7_u2-x86_64/gnu-cuda/lib

-------------------------------------------------------------------

 

$ module load gromacs/4.6.7-cuda

gromacs/4.6.7-cuda(12):ERROR:151: Module 'gromacs/4.6.7-cuda' depends on one of the module(s) ''

gromacs/4.6.7-cuda(12):ERROR:102: Tcl command execution failed: prereq cuda

To resolve the above error, simply load the “prereq” module first, then load the original module. First you might want to see what “cuda” modules are available:

 

$ module avail cuda

---------------------- /apps/usr/modules/gpu ----------------------

cuda/7.5(default)    cuda/8.0

Select one that you would like to load to satisfy Gromacs requirements. You can do this in a single command:

 

$ module load cuda/8.0 gromacs/4.6.7-cuda


More information

You can find more information about Environment Modules on SourceForge.net:http://modules.sourceforge.net