Skip Nav U.S. Army Research Laboratory DoD Supercomputing Resource Center
Sitemap Contact Us Quick Links

System Software

Modules Information


Table of Contents

Introduction
Module Commands
Initializing the Modules Software


Introduction

Modules provides an easy mechanism for dynamically updating a user's environment, especially the PATH, MANPATH, NLSPATH, and LD_LIBRARY_PATH environment variables to name a few. Each module contains the information needed to configure the shell for an application or library. To perform this in the current shell, the modules package uses the shell's eval 'command' mechanism for running a program that outputs shell commands and then executes them. There are some limitations and preferred ways for setting up the modules environment because of this implementation. Modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the existing shared modulefiles.

Module Commands

module help [modulefile...]
Print the usage of each sub-command. If an argument is given, print the Module specific help information for the modulefile.
module load modulefile [modulefile...]
Load modulefile into the shell environment.
module unload modulefile [modulefile...]
Remove modulefile from the shell environment.
module switch modulefile1 modulefile2
Switch loaded modulefile1 with modulefile2.
module display modulefile [modulefile...]
The display sub-command will list the full path of the modulefile and all (or most) of the environment changes the modulefile will make if loaded.
module list
List loaded modules.
module 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.
module use [-a|--append] directory [directory...]
Prepend directory to the MODULEPATH environment variable. The --append flag will append the directory to MODULEPATH.
module unuse directory [directory...]
Remove directory from the MODULEPATH environment variable.
module update
Attempt to reload all loaded modulefiles. The environment will be reconfigured to match the saved ${HOME}/.modulesbeginenv and the modulefiles will be reloaded.
module clear
Force the Modules Package to believe that no modules are currently loaded.
module purge
Unload all loaded modulefiles.

Initializing the Modules Software

Users are strongly encouraged to get a copy of our sample init files using /usr/cta/modules/samples/update-init so that they can use modules. This process makes a copy of your current .cshrc and .profile so none of your personal settings are lost. We then recommend you put your personal settings and aliases into a .cshrc.pers or .profile.pers file. If you prefer to just all the lines to your .cshrc yourself, please use one of the following code snippets.

/bin/csh users can use modules by adding this to their .cshrc:

if (-f /usr/cta/modules/3.1.6/init/csh ) then
  setenv LD_LIBRARY_PATH /usr/local/lib
  source /usr/cta/modules/3.1.6/init/csh
  module load Master
endif
  

/bin/tcsh users can use modules by adding this to their .cshrc:

if (-f /usr/cta/modules/3.1.6/init/tcsh ) then
  setenv LD_LIBRARY_PATH /usr/local/lib
  source /usr/cta/modules/3.1.6/init/tcsh
  module load Master
endif
  

/bin/bash users should add this to their .profile file:

if [ -f /usr/cta/modules/3.1.6/init/bash ]
then
  export LD_LIBRARY_PATH=/usr/local/lib
  . /usr/cta/modules/3.1.6/init/bash
  module load Master
fi
  

/bin/ksh users should add this to their .profile file:

if [ -f /usr/cta/modules/3.1.6/init/ksh ]
then
  export LD_LIBRARY_PATH=/usr/local/lib
  . /usr/cta/modules/3.1.6/init/ksh
  module load Master
fi
  

/bin/sh users should add this to their .profile file:

if [ -f /usr/cta/modules/3.1.6/init/sh ]
then
  export LD_LIBRARY_PATH=/usr/local/lib
  . /usr/cta/modules/3.1.6/init/sh
  module load Master
fi
  

The modules software also supports the following shells: perl - python - zsh. If you are having trouble configuring modules to run under your shell, please contact the CCAC.