Environment 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 a clean fashion. All popular shells are supported, including bash, ksh, zsh, sh, csh, tcsh, as well as some scripting languages such as perl and python.

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.

For more information see the Forge Wiki

 

module avail
Demonstration of "module avail" command in use.
2-module-avail.png
Demonstration of "module avail" command in use.
3-module-load-list.png
Demonstration of "module load" and "module list"
4-module-conflict.png
Demonstration of "module load" with a conflict.
5-module-swap.png
Demonstration of swapping a module that is in conflict using "module swap"
6-module-whatis-help.png
Demonstration of "module whatis" and "module help"
7-module-whatis.png
Demonstration of using "module whatis" to list modules and their descriptions.
8-module-whatis2.png
Demonstration of using "module whatis" to list modules and their descriptions.
9-module-whatis3.png
Demonstration of using "module whatis" to list modules and their descriptions.
10-module-whatis4.png
Demonstration of using "module whatis" to list modules and their descriptions.

Usage of Environment Modules

savemodules will save your currently loaded set of modules for all future logins.

unsavemodules will clear the saved modules so that they will not load on next login.

module [switches] [sub-command] [sub-command-args]

module is a user interface to the Modules package. The Modules package provides for the dynamic modification of the 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.

The modulefiles are added to and removed from the current environment by the user. The environment changes contained in a modulefile can be summarized through the module command as well. If no arguments are given, a summary of the module usage and sub-commands are shown.

The action for the module command to take is described by the sub-command and its associated arguments.  

Command line switches

The module command accepts command line switches as its first parameter. These may be used to control output format of all information displayed and the module behavior in case of locating and interpreting module files.

All switches may be entered either in short or long notation. The following switches are accepted:

 

--help, -H
Give some helpful usage information, and terminates the command.
--version, -V
Lists the current version of the module command, and some configured option values. The command then terminates without further processing.
--force, -f
Force active dependency resolution. This will result in modules found on a prereq command inside a module file being load automatically. Unloading module files using this switch will result in all required modules which have been loaded automatically using the -fswitch being unload. This switch is experimental at the moment.
--terse, -t
Display avail and listoutput in short format.
--long, -l
Display avail and listoutput in long format.
--human, -h
Display short output of the avail and listcommands in human readable format.
--verbose, -v
Enable verbose messages during module command execution.
--silent, -s
Disable verbose messages. Redirect stderr to /dev/null if stderr is found not to be a tty. This is a useful option for module commands being written into .cshrc, .login or .profile files, because some remote shells (as rsh(1)) and remote execution commands (like rdist) get confused if there is output on stderr.
--create, -c
Create caches for module avail and module apropos. You must be granted write access to the ${MODULEHOME}/modulefiles/ directory if you try to invoke module with the -coption.
--icase, -i
Case insensitive module parameter evaluation. Currently only implemented for the module aproposcommand.
--userlvl <lvl>, -u <lvl>
Set the user level to the specified value. The argument of this option may be one of:

novice, nov Novice

expert, exp Experienced module user

advanced, adv Advanced module user  

Module Sub-Commands

help   [modulefile...]
Print the usage of each sub-command. If an argument is given, print the Module-specific help information for the modulefile(s).
add    modulefile...
load   modulefile...
Load modulefile(s) into the shell environment.
rm     modulefile...
unload modulefile...
Remove modulefile(s) from the shell environment.
swap   [modulefile1] modulefile2
switch [modulefile1] modulefile2
Switch loaded modulefile1 with modulefile2. If modulefile1 is not specified, then it is assumed to be the currently loaded module with the same root name as modulefile2.
show    modulefile...
display modulefile...
Display information about one or more modulefiles. The display sub-command will list the full path of the modulefile(s) and all (or most) of the environment changes the modulefile(s) will make if loaded. (It will not display any environment changes found within conditional statements.)
list
List loaded modules.
avail [path...]
List all available modulefiles in the current MODULEPATH. All directories in the MODULEPATH are recursively searched for files containing the modulefile magic cookie. If an argument is given, then each directory in the MODULEPATH is searched for modulefiles whose pathname match the argument. Multiple versions of an application can be supported by creating a subdirectory for the application containing modulefiles for each version.
use [-a|--append] directory...
Prepend one or more directories to the MODULEPATH environment variable. The --append flag will append the directory to MODULEPATH.
unuse directory...
Remove one or more directories from the MODULEPATH environment variable.
update
Attempt to reload all loaded modulefiles. The environment will be reconfigured to match the environment saved in ${HOME}/.modulesbeginenv (if BEGINENV=1) or the file pointed at by $MODULESBEGINEV (if BEGINENV=99) and the modulefiles will be reloaded. This is only valid if modules was configured with --enable-beginenv (which defines BEGINENV), otherwise this will cause a warning. update will only change the environment variables that the modulefiles set.
clear
Force the Modules package to believe that no modules are currently loaded.
purge
Unload all loaded modulefiles.
refresh
Force a refresh of all non-persistent components of currently loaded modules. This should be used on derived shells where aliases need to be reinitialized but the environment variables have already been set by the currently loaded modules.
whatis [modulefile...]
Display the information set up by the module-whatis commands inside the specified modulefile(s). If no modulefile is specified, all 'whatis' lines will be shown.
apropos string
keyword string
Seeks through the 'whatis' informations of all modulefiles for the specified string. All module-whatis informations matching the string will be displayed.
initadd modulefile...
Add modulefile(s) to the shell's initialization file in the user's home directory. The startup files checked (in order) are:
csh - .modules, .cshrc(.ext), .csh_variables, and .login(.ext)
tcsh - .modules, .tcshrc, .cshrc(.ext), .csh_variables, and .login(.ext)
sh and ksh - .modules, .profile(.ext), and .kshenv(.ext)
bash - .modules, .bash_profile, .bash_login, .profile(.ext), and .bashrc(.ext)
zsh - .modules, .zcshrc(.ext), .zshenv(.ext), and .zlogin(.ext)

If a 'module load' line is found in any of these files, the modulefile(s) is(are) appended to any existing list of modulefiles. The 'module load' line must be located in at least one of the files listed above for any of the 'init' sub-commands to work properly. If the 'module load' line is found in multiple shell initialization files, all of the lines are changed.

initprepend modulefile [modulefile...]
Does the same as initadd but prepends the given modules to the beginning of the list.
initrm modulefile...
Remove modulefile(s) from the shell's initialization files.
initswitch modulefile1 modulefile2
Switch modulefile1 with modulefile2 in the shell's initialization files.
initlist
List all of the modulefiles loaded from the shell's initialization file.
initclear
Clear all of the modulefiles from the shell's initialization files.

Available Modules

Notice the modules on the cluster are always being updated, so the list here may not always be the most recent.  You can get the most recent list by running the "module avail" command on the cluster.

Module Description
dot adds `.' to your PATH environment variable
module-cvs get most recent module sources from CVS or ftp
module-info returns all various module-info values
modules loads the modules environment
null does absolutely nothing
rocks-openmpi adds `.' to your PATH environment variable
use.own adds your own modulefiles directory to MODULEPATH
amber12 Adds amber12 to the path
ansys-15 Adds Ansys-15 and fluent UDF to path
arpack Setup arpack libraries for linking
casino Loads Support Libraries for casino
comsol Adds COMSOL 4.3 to path and load support libraries
comsol-4.4 Adds COMSOL-4.4 to the path
cuda/4.2 Adds CUDA-4.2 libraries to the path
cuda/4.2 Provides CUDA 4.2 Library Support
cuda/6.0 Provides CUDA-6.0 Library Support
dirac Adds dirac to the path
dock Adds openmpi gnu compilers and dock6 to the path
fftw-3.3.4 Adds fftw-3.3.4 libraries to the path
fluent-udf Adds Fluent UDF compiler to the path
fnl601 Set up environment for fnl601
gamess Set up environment for openmpi (gnu) over ethernet and gamess
gamess-2014-05-07 Set up environment for openmpi (gnu) over ethernet and gamess
gamess-new Set up environment for openmpi (gnu) over ethernet and gamess
gamess-old Set up environment for openmpi (gnu) over ethernet and gamess
gaspi Set up environment for gaspi libraries
gcc/45 Provides OpenMPI gcc45 C and Fortran Compilers
gcc/46 Provides OpenMPI gcc45 C and Fortran Compilers
gcc/47 Provides OpenMPI gcc45 C and Fortran Compilers
intel/intel-11 Provides Intel 11 C and Fortran Compilers & MKL
intel/intel-12 Provides Intel 12 C and Fortran Compilers & MKL
intel/mkl-12 Provides Intel 12 C and Fortran Compilers & MKL
lam-gnu Adds lammpi (gnu) to the path.
lam-intel Adds lammpi (intel-12) to the path.
lammpi/gnu Provides lammpi gcc and gfortran Compilers
lammpi/intel-11 Provides lammpi Intel 11 Compilers
lammpi/intel-12 Provides lammpi Intel 10 Compilers
lammps Configures openmpi(intel-12) and LAMMPS
lsdyna Adds LS-DYNA to the path
maple-14 Adds Maple-14 to the path
maple-16 Adds Maple 16 to the path
matlab-2012 Adds matlab 2012a to the path
matlab-2013 Adds Matlab-2013a to the path
matlab-2014 Adds Matlab 2014a to the path.
matlab/2014 Adds Matlab 2014a to the path.
matlab/2013 Adds Matlab-2013a to the path
matlab/2012 Adds matlab 2012a to the path
mctdh Configures mctdh-84.9
molpro-2010 Adds molpro-2010 to path
molpro-2012 Adds molpro-2012 to path
molpro-2012s Adds molpro-2012s to path.
mpb-meep Adds mpd-meep to the path
mpich2/gnu Provides mpich2 gcc and gfortran Compilers
mpich2/intel-11 Provides mpich2 Intel 11 Compilers
mpich2/intel-12 Provides mpich2 Intel 12 Compilers
mpich2-eth-gnu Adds mpich2 (gnu) to the path.
mpich2-eth-intel Adds mpich2 (Intel-12) to the path
namd Adds namd to the path
nx-8.0 Adds NX-8.0 to the path
nx-8.5 Adds NX-8.5 to the path
openmpi/gcc45 Provides OpenMPI gcc45 C and Fortran Compilers
openmpi/gcc46 Provides OpenMPI gcc46 C and Fortran Compilers
openmpi/gcc47 Provides OpenMPI gcc47 C and Fortran Compilers
openmpi/gnu Provides OpenMPI gnu C and Fortran Compilers
openmpi/intel-11 Provides OpenMPI Intel 11 C and Fortran Compilers
openmpi/intel-12 Provides OpenMPI Intel 12 C and Fortran Compilers
openmpi/mkl-12 Provides OpenMPI Intel 12 C and Fortran Compilers
openmpi/pgi-11.4 Provides OpenMPI PGI 11.4 C and Fortran Compilers
openmpi-gnu Adds openmpi (GNU) to the path
openmpi-intel Adds openmpi (Intel-12) to the path.
pgi/pgi-11.4 Provides PGI 11.4 C and Fortran Compilers
python-latest Adds Python-2.7.2 to the path.
qiime Adds QIIME to the path.
scalapack Set up environment for scalapack library.
starccm/6.04 Set up environment for openmpi (Intel) over ethernet and STARCCM+
starccm/7.04 Set up environment for openmpi (Intel) over ethernet and STARCCM+
starccm/8.04 Set up environment for openmpi (Intel) over ethernet and STARCCM+