NERSCPowering Scientific Discovery Since 1974

Modules

Modules Approach to Managing The Environment

Modules is a system which you can use to specify what software you want to use.  If you want to use a particular software package loading its module will take care of the details of modifying your environment as necessary.  The advantage of the modules approach is that the you are not required to explicitly specify paths for different executable versions and try to keep their related man paths and environment variables coordinated.  Instead you simply "load" and "unload" specific modules to control your environment.

Getting Started with Modules

If you're using the standard startup files on PDSF then you're already setup for using modules. If the "module" command is not available, please clean up your login environment.

Using Modules

The most common module commands are shown below.  Note that a given package might only work in the chos environment in which it was built.  See the "module show" command below for how to get details about a package, and see also the Chos page for more information about chos.

ActionHow to do itComment
See all available packages and versions module avail This will show all versions of all modules as well as which one is the default.
See versions of a particular package module avail <package> Less verbose output if you know what package you are interested in.
Load some software package module load <package> If you don't specify a version explicitly you will get the default as shown with "module avail".
Unload some software package module unload <package> Loading a package is reversible - you just unload it.
See what software packages you have loaded module list Note that some modules are loaded for you automatically upon login.
Get details about some software package module show <package> This will show how your environment gets modified and also some information about the module including what chos it is built in (for more recent packages).
List all module commands module help  

Best Practices

When loading modules in a batch script (or any script), it's recommended to use the full version number, i.e. instead of doing "module load python" do "module load python/2.7.6". This will preserve a record of the software version that was loaded to run your job. When you do "module load <package>" the default version is loaded. However, as new software versions come out, the default version of a module may change to point to a newer version. Generally, these changes will be announced via email, but it's better for consistency to always use the full module name in any important scripts.

Also, bash script that use modules require bash to be invoked as a login shell. This can be done by starting your script with "#!/bin/bash -l".

Customizing Modules

For loading a particular set of modules automatically at login, place the module load commands in your ~/.cshrc.ext file.  See Shells and Startup Files for more information.