Skip to main content

How can I use modules to set up application environments?

Modules are used to set environment variables for the purpose of managing access to applications and libraries on CARC supercomputers and clusters. The command module avail list all available modules on the machine to which you are logged in. To load a module, use the module load command. For example, to load the module for the Intel compiler, use the command module load compiler/intel. After issuing this command, the command module list will display:

Currently Loaded Module files:

1) compiler/intel/14.0.2

To use OpenMPI with the Intel compilers, use the command module load openmpi/intel. Continuing the previous example, after loading the openmpi/intel module, the output of module list should look like the following:

Currently Loaded Module files:

1) compiler/intel/14.0.2 3) openmpi/intel

2) mx/1.2.16

To unload modules, use the module unload command. For example: module unload openmpi/intel. To remove all loaded modules, use the command module purge.

To use modules in a PBS script based on csh/tcsh, include the following line after your #PBS specifications:

source /etc/profile.d/module.csh

Then load the relevant modules that you require, e.g.

module load openmpi/1.6.3/pgi/12.8

to run a code compiled with the PGI compiler and the Open MPI message-passing library.