Getting Started with Modules

What are Modules?

The Nova cluster provides hundreds of software applications.  Each application has a module name.   You will need to use the module load modulename command to load the module into your environment, which basically means the application's commands are added to your PATH.  

Find a Package

Use the module spider command to search for module names.  Here are some examples:

  1. Search for the gcc compiler:

$ module spider gcc

--------------------------------------
 gcc:
--------------------------------------
    Versions:
       gcc/8.5.0-vgowph4
       gcc/12.2.0-khmr45w

This shows modules for two gcc versions:  8.5.0 and 12.2.0.   (The random letters at the end of the module name are called the "hash", which adds a unique identifier in case there are multiple instances of a package with the same version number.) 

To load gcc 12.2.0, you can do:    module load gcc/12.2.0-khmr45w

or (because there is only one version of gcc 12.2):  module load gcc/12.2

2. Search for Python version 3.10:

$ module spider python/3.10 

--------------------------------------------------
 python: python/3.10.10-zwlkg4l
--------------------------------------------------

   This module can be loaded directly: module load python/3.10.10-zwlkg4l

   Help:
     The Python programming language.

Show All Available Packages

To list all the packages that are available to you, do:

$ module available

Because this lists all packages, the output will be fairly long, so command will send the output to the more command that allows you to step through each screen full of output by pressing the space bar.

If you want rather have a single column list, say, to save in a file or to search with grep, use the --terse or -t option along with --redirect (which sends the output to standard output):

$ module -t --redirect available

Load a Package

Once you know the module name of the package, you can add the packages to your current shell session ( or into a sbatch script) with a module load <package> command:

$ module load gcc/12.2.0 python/3.10

Observe that multiple modules can be loaded with one command

List the Packages You Have Loaded

To see the packages currently active in your environment, use the module list command:

$ module list

To get a simple list of what is loaded, add the --terse or -t  option:
$ module -t list

Unload a Package

You can also unload a module using the module unload <package> command:

$ module unload python/3.10

Purge All Modules

If you want to purge all modules, do:  module purge

Further Details

This page serves as a fairly quick introduction to software modules.  If you'd like to see more details, especially with regards to module dependencies, see the Modules article under Guides.