University of California

Modules Environment

A variety of useful packages are stored in the environment modules system which you can access using the module command. This will show you a list of what is available:

$ module avail

You can see all current modules in effect in your environment at any time by using the list option:

$ module list

The Modules software package allows you to dynamically modify your user environment setting. Module commands set, change, or delete environment variables, typically in support of a particular application. They also let the user choose between different versions of the same software or different combinations of related codes.

Accessing Environment Modules on ShaRCS

ShaRCS has implemented the Modules approach to managing the user environment for different software versions. The distinct advantage of the modules approach is that the user is no longer required to explicitly specify paths for different executable versions, and try to keep the MANPATH and related environment variables coordinated. With the Modules approach, users execute simple shell commands to load and unload available modules that are preconfigured with the environments they need.

Modules provides an easy mechanism for updating a user's environment, especially the PATH, MANPATH, NLSPATH, and LD_LIBRARY_PATH environment variables, just to name a few. To perform this in a Linux shell, Modules uses the shell's 'eval' command mechanism for running a program that outputs shell commands and then executes them. Because of this, there are some limitations and preferred ways for setting up the Modules environment. For more information, see the Modules manual at SourceForge.

With simple shell commands, you can configure your shell environment for any package available on the cluster. In the case of packages with multiple versions, there are options to switch between one version and another - defining and undefining variables as needed. If there is a conflict between two packages, Modules will alert you.

Common Modules Commands

Command option Description
module help module_name Show help for a given module
module avail List all available modules packages
module load module_name Load settings for module_name into current environment
module unload module_name Remove settings for module_name from current environment
module switch old_module_namenew_module_name Unload old_module_name and load new_module_name
module swap old_module_namenew_module_name Same as module switch
module purge Remove all module settings from current environment
module display module_name Display settings for module_name
module show Show environment changes that will be made by loading a given module.
module list List modules currently loaded in a user's environment. A module is considered loaded when its associated modulefile has been executed and the user's environment contains the changes from the modulefile.

Example

[n0000 ~]$ module list
No Modulefiles Currently Loaded.
[n0000 ~]$ module avail

---------------- /usr/Modules/modulefiles ---------------------------------------------
dot module-info modules null use.own

---------------- /global/north/software/centos-5.x86_64/modules/modfiles ---------------------
fftw/2.1.5-intel icc/10.1.018(default) mkl/10.0.4.023 openmpi/1.2.7-intel(default)
fftw/3.1.2-intel ifort/10.1.018(default) openmpi/1.2.7-gcc
[n0000 ~]$ module load icc/10.1.018
[n0000 ~]$ module list
Currently Loaded Modulefiles:
1) icc/10.1.018
[n0000 ~]$  

Using Modules with TORQUE (PBS) batch scripts

To set up package environment variables for batch first use the module command in your terminal session and then use msub to export the variables to batch. For example, assume your job requires access to Intel compilers.

Add the module load commands into your job script like the below example:

#!/bin/sh
#PBS -l nodes=4:ppn=2
module load openmpi/1.3.3-intel
module load mkl/10.0.4.023
mpirun ~/mpi-test

Default Software Environment

When you get an account on the ShaRCS clusters, your dot-files should be set up correctly to use modules. If you delete or modify these files in such a way to make modules fail, contact the ShaRCS consultants for help. The default login shell is set to bash. If you wish to change this, contact ShaRCS Help.

The default user login should have their PATH defined to include the following:

  • PBS Resource Manager command
  • Moab Scheduler command
  • Intel serial compilers
  • Intel-based OpenMPI parallel compilers

Warewulf cluster toolkit commands are also available on the North cluster.

Partial list of installed software applications

  • Tools/utilities: bc, ImageMagick, gnuplot, xmgrace
  • Math and numerical libraries: fftw2, fftw3, GSL, MKL, Scalapack
  • MPI: OpenMPI (we will only support OpenMPI not MPICH and MVAPICH)
  • Compilers: icc/ifort, pgi
  • Debuggers and profilers: Alinea DDT, Intel idb, TAU, Valgrind
  • Applications and Packages: VASP, R, Octave, ABINIT, Matlab, Q-Chem, PAUP, Gaussian, Amber
  • I/O libraries: HDF4, HDF5, NetCDF, NCO