Distributed Environment Modules

Overview

This page covers the distributed environment modules on OSG Connect and how to use them to provide workflows with a consistent environment when running.

Introduction

Environment modules have historically been used in HPC environments to provide users with an easy way to access different versions of software and to access various libraries, compilers, and software.  OSG Connect uses environment modules for similar reasons as well as to provide consistent environments to test and run workflows.   OSG Connect uses an implementation of the module system called Lmod to provide the typical module services as well as to allow modules to record dependencies.  All modules and binaries for applications and libraries are published on OASIS, a distributed filesystem that is available on most of the sites that run OSG Connect jobs, providing a consistent environment on these resources.  This allows for users to test workflows on the OSG Connect login nodes and then submit the same workflows without making any changes.

Using Distributed Environment Modules on OSG Connect

Initialization

The first step to using distributed environment modules is to initialize the module system.  This step consists of sourcing a shell specific file that then adds the module command to your environment.  For example, if you use bash then this can be done by running the following:

Initializing module for bash
[user@login01 ~]$ source /cvmfs/oasis.opensciencegrid.org/osg/modules/lmod/5.6.2/init/bash

For other shells such as sh, zsh, tcsh, csh, etc., you would replace bash with the shell name (e.g. zsh).

Using Distributed Environment Modules

Once the distributed environment modules system is initialized, you can then uses module avail to see available modules, e.g.:

Listing available modules
[user@login01 ~]$ module avail

--------------------------- /cvmfs/oasis.opensciencegrid.org/osg/modules/modulefiles/Core ----------------------------
   atlas      fftw/fftw-3.3.4-gromacs    lapack              lmod/5.6.2 (D)    python/3.4
   blast      gromacs/4.6.5              lmod/SiteHook       namd/2.9          settarg/5.6.2
   blender    jpeg                       lmod/SitePackage    python/2.7 (D)

  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".

In order to load a module, you should run module load [modulename], e.g.

Loading modules
[user@login01 ~]$ module load python/2.7

Some modules require other modules to be loaded, if that occurs then you'll get an error message indicating this:

Package Dependences
[user@login01 ~]$ module load all-pkgs

Lmod has detected the following error: Cannot load module "all-pkgs" without these modules loaded:
  atlas, lapack


While processing the following module(s):

Module fullname  Module Filename
---------------  ---------------
all-pkgs         /cvmfs/oasis.opensciencegrid.org/osg/modules/modulefiles/python/2.7.7/all-pkgs.lua

In addition, some modules such as the all-pkgs for python won't be available until the relevant packages are loaded, e.g.:

Dependent availability of packages
[user@login01 ~]$ module avail

--------------------------- /cvmfs/oasis.opensciencegrid.org/osg/modules/modulefiles/Core ----------------------------
   atlas      fftw/fftw-3.3.4-gromacs    lapack              lmod/5.6.2 (D)    python/3.4
   blast      gromacs/4.6.5              lmod/SiteHook       namd/2.9          settarg/5.6.2
   blender    jpeg                       lmod/SitePackage    python/2.7 (D)

  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".

[user@login01 ~]$ module load python/2.7
[user@login01 ~]$ module avail

----------------------- /cvmfs/oasis.opensciencegrid.org/osg/modules/modulefiles/python/2.7.7 ------------------------
   all-pkgs

--------------------------- /cvmfs/oasis.opensciencegrid.org/osg/modules/modulefiles/Core ----------------------------
   atlas      fftw/fftw-3.3.4-gromacs    lapack              lmod/5.6.2 (D)    python/3.4
   blast      gromacs/4.6.5              lmod/SiteHook       namd/2.9          settarg/5.6.2
   blender    jpeg                       lmod/SitePackage    python/2.7 (D)

  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".

To unload a package and remove it from the environment, you should use module unload [modulename], e.g.:

Unloading packages
[user@login01 ~]$ module unload python/2.7

To see currently loaded modules, you can should use module list , e.g.:

Listing currently loaded modules
[user@login01 ~]$ module list
Currently Loaded Modules:
  1) python/2.7

Finally, module help will give you more detailed information.

Available Software

A list of current modules currently available is given below:

SoftwareModulenameNotes
Python 2.7python/2.7Interpreter for the python programming language
Modules for Python 2.7all-pkgsOnly available after python 2.7 module loaded, requires atlas and lapack modules to be loaded.  Provides Numpy, Scipy, Scikit-learn, matplotlib, Pandas, and  NLTK
Python 3.4python/3.4Interpreter for the python programming language
Modules for Python 3.4all-pkgsOnly available after python 3.4 module loaded, requires atlas and lapack modules to be loaded.  Provides Numpy, Scipy, Scikit-learn, matplotlib, and  Pandas
ATLAS LibrariesatlasATLAS 3.10.1 libraries.  Libraries for linear algebra.
LAPACK librarieslapackLAPACK 3.5.0 libraries.  Libraries for linear algebra.
NAMDnamd/2.9NAMD 2.9.  Molecular dynamics simulator.
gromacsgromacs/4.6.5Gromacs molecular dynamics simulator. Requires fftw/fftw-3.3.4-gromacs, lapack, and atlas modules to be loaded.
FFTWfftw/fftw-3.3.4-gromacsFFTW is a library for fast fourier transforms. FFTW 3.3.4 library compiled with gromacs specific options.
blenderblenderBlender 3D rendering software.
RR/3.1.1The R language interpreter is a domain specific language designed for statistical analysis.