Modules

There are many software packages installed on the Yale clusters in addition to those installed in the standard system directories. This software has been custom built for use on our clusters at the request of our users. In order to manage these additional packages, the clusters use module files. These module files allow you to easily specify which versions of which packages you want use.

List all loaded module files

The "module list" command displays all of the module files that are currently loaded in your environment:

$ module list

Find available module files

To list all available module files, execute:

$ module avail

You can also list all module files whose name contains a specified string. For example, to find all Python module files, use:

$ module avail python

If you don't find your required software in the list of modules, feel free to send us a software installation request to hpc@yale.edu.

Loading and unloading module files

The "module load" command is used to modify your environment so you can use a specified software package. For example, now that you have listed the available software and found Python version 2.7.6, which you want to load, execute the command:

$ module load Langs/Python/2.7.6

This modifies the PATH environment variable (as well as a few others) so that your default Python interpreter is version 2.7.6:

$ python -V
Python 2.7.6

You don't have to specify the version. For example, if you want the default module version of R, use:

$ module load Apps/R

You can also unload a module that you've previously loaded:

$ module unload Apps/R

Automatically loading modules on log in

It can be a pain to have to enter a long list of "module load" commands every time you log on to the cluster. There are two easy ways to make sure that modules you need are loaded every time you log in.

Saved Environments

The modules software also allows users to create "saved environments" that remember a set list of modules to load together. This method is particularly useful if you have two or more module sets that may conflict with one another.

To create a saved environment, simply load all of your desired modules and then type

$ module save

This will save this set of modules as your default set. To save a set as a non-default, just assign the environment a name:

$ module save environment_name

To load all the modules in the set, enter

$ module restore
$ module restore environment_name

to load the default or specified environment, respectively. To modify an environment, restore the environment, make the desired changes by loading and/or unloading modules and save it to the same name. To get a list of your environments, run:

$ module savelist

Loading modules with your .bashrc file (Only on Omega):

In your home directory there is a hidden file called ".bashrc". This acts as a small bash script that runs every time you start a new session on the cluster. To automatically load your modules on log in, open ~/.bashrc in the text editor of your choosing and then insert your list of module load commands into this file (one per line). Restart your session (log out and log back in), and you should see that all of your modules have been automatically loaded. Using this method extensively can lead to difficulties in updating software and debugging, so only use this method on Omega.

More Information

You can view documentation while on the cluster using the command:

$ man module

Here are some links to additional documentation: