Use modules to manage your software environment on IU research supercomputers

On this page:


Overview

The IU research supercomputers use module-based environment management systems that provide a convenient method for dynamically customizing your software environment. Big Red 3 and Carbonate use the Modules module management system; Quartz uses the Lmod module management system.

Each module contains commands for handling dependencies and setting environment variables (for example, PATH, LD_LIBRARY_PATH, and MANPATH) that are needed to run a particular application (or a particular version of an application) in your user environment. You can load and unload modules to automatically modify environment variables as needed when switching between software packages.

Commands that are common between Modules and Lmod

Modules and Lmod share some common commands; for example:

Command Action
module avail List all software packages available on the system.
module avail package List all versions of package available on the system; for example, module avail openmpi.
module list List all packages currently added to your user environment.
module load package Add the default version of the package to your user environment; for example, module load intel.
module load package/version Add the specified version of the package to your user environment; for example, module load intel/18.0.2.
module unload package Remove the specified package from your user environment.
module swap package_A package_B Swap the loaded package (package_A) with another package (package_B). This is synonymous with module switch package_A package_B.
module show package Show the changes, such as environment variables set and library paths added, that loading the specified module (package) makes to your user environment. This is synonymous with module display package.

For more about the module command in Modules, see its manual page.

For more about the module command in Lmod, see User Guide for Lmod.

About module hierarchies in Lmod

Although Modules and Lmod are similar in some respects, there are differences between them. One significant difference is Lmod's use of module hierarchies. When you invoke module avail in Lmod, it will by default show only those modules that are compatible with the modules that are currently loaded in your environment. For example, GNU is the default compiler environment on Quartz; when you run module avail on Quartz, Lmod will list only modules that are compatible with GNU and modules that do not have any compatibility or dependency characteristics. To find modules that depend on OpenMPI, you first must load an OpenMPI module.

To search for all modules that are available, regardless of compatibility, use the Lmod module spider command, which lists all the modules available on the system. To search for a specific module (package), use module spider package.

Make permanent changes to your user environment

Using Modules or Lmod, you can save your customized user environment so that it loads every time you start a new session.

In Modules

Whenever you open a new shell, Modules looks for a .modules file in your home directory and executes any module commands it finds there.

For example, if the Intel 13 and GCC 4.7 compilers are always wanted, but the Open MPI libraries might be either GNU or Intel, a typical .modules file might look like this:

module load core
module load gcc/4.7.2
module load intel/13.0.1
module load openmpi/intel/1.6.3
# openmpi/gnu/1.6.3
module load fftw/intel/3.3.3

Placing a # at the start of a line makes the entire line inactive.

To change between the modules, simply edit and source the file.

In Lmod

In Lmod, you can add module commands to the .bash_profile file in your home directory. If your .bash_profile file contains other commands, you can add module commands to the end of the file.

For example, if the Matlab and SPSS software are always wanted, a typical .bash_profile file might look like this:

#previously existing content
module load matlab
module load spss
# openmpi/gnu/4.0.5

This is document bcwy in the Knowledge Base.
Last modified on 2021-04-15 11:44:43.