Skip to content

Using Software at the CHPC with Modules

Modules is an environment management tool which allows users to load software by modifying the user's shell environment in a simple and dynamic way. The advantage of modules primarily comes from the capability to quickly and easily load and unload the environment needed for a given software package.

This page discusses how to search for, load, unload, and amend modules at the CHPC. Additionally, there is a short training video that covers the basics of modules. 

CHPC uses the Lmod version of modules produced by TACC. For more information, please visit the Lmod documentation page.https://www-test.chpc.utah.edu/documentation/software/modules.php

For more information on modules outside of the scope of this page, please see the Advanced Modules Guide.

On this page

The table of contents requires JavaScript to load.

How to Search for Available Software

The CHPC has installed over a thousand different software packages to allow users to complete their research activities. There are several different ways to search for a module:

  • https://www-test.chpc.utah.edu/documentation/software/modules.phpmodule spider XX*
  • ml spider XX*
  • module keyword XX*
  • ml keyword XX*
  • module avail

* XX should be the module name or keyword for the software

 

Can't find the software you need? Email helpdesk@chpc.utah.edu with the name of and link to the requested software with a short explanation of why you need the software, and a member of our User Services team will install it for you.

An important note about module avail is that the command does not show all packages that exist on the system. The reader may notice there are no MPI modules listed; this is because the use of an MPI library depends on having a compiler loaded through the module hierarchy. To see a list of all  available modules, please use the command module spider.

To search for a specific module, specify a name:

$ module spider openmpi
----------------------------------------------------------------------------------------------------------
openmpi:
----------------------------------------------------------------------------------------------------------
     Versions:
...
        openmpi/4.1.5-gpu
        openmpi/4.1.5
        openmpi/4.1.6-gpu
        openmpi/4.1.6
        openmpi/5.0.3-gpu
      openmpi/5.0.3
----------------------------------------------------------------------------------------------------------
To find detailed information about openmpi please enter the full name.
  For example:
    $ module spider openmpi/5.0.3
----------------------------------------------------------------------------------------------------------

Then execute spider with a version as well and receive instructions on how to load the module:

$ ml spider openmpi/5.0.3
---------------------------------------------------------------------------------------------------------------------------------------------------
  openmpi: openmpi/5.0.3
---------------------------------------------------------------------------------------------------------------------------------------------------

    This module can be loaded directly: module load openmpi/5.0.3

    Additional variants of this module can also be loaded after loading the following modules:

      gcc/11.2.0
...
That the openmpi/5.0.3 can be loaded directly means that it has been built with the gcc/8.5.0 compiler that ships with the Rocky 8 Linux operation system. Additionally, this openmpi has been built with newer gcc/11.2.0. To be able to see the modules that have been built with this OpenMPI, you need to load its module. That is, either just load openmpi/5.0.3 to use gcc/8.5.0, or load gcc/11.2.0 and openmpi/5.0.3 to use gcc/11.2.0.
 
We periodically deprecate older versions of programs by hiding their modules. To also show the hidden modules, use the --show-hidden option in the module avail, spider, etc. commands. Hiding a module does not affect its loading capability, module load can be executed on a hidden module without the need for --show-hidden.

How to Load/Unload Software

Users can easily load and unload software enter their environment with the module load and module unload commands. ml can be a replacement for 'module load'. To see what software is loaded into your environment, use the module list command.

Loading a module:

$ module load bwa
$ module list
1) chpc/1.0 (S) 2) bwa/2020_03_19

Where:
S: Module is Sticky, requires --force to unload or purge

Multiple modules can be loaded at a time. Some module combinations do not work, as some might be dependent on different versions of the same software. Additionally, if you have one version of a module loaded and go to load a different version of the same module, the currently loaded module will be unloaded automatically.

 

You will notice in any module list output that the first option will be 1) chpc/1.0. Please do not unload this module, as it automatically loads a specific CHPC environment for the user's profile to work properly.

Unloading a module:

$ module list
1) chpc/1.0 (S) 2) bwa/2020_03_19

Where:
S: Module is Sticky, requires --force to unload or purge

$ module unload bwa
$ module list
1) chpc/1.0 (S)

Where:
S: Module is Sticky, requires --force to unload or purge

Customizing CHPC modules

Users can customize the way how the modules are named and shown using the ~/.modulerc file.  The ~/.modulerc file syntax is as follows:

if { [info exists ::env(LMOD_VERSION_MAJOR)] } {
#Lmod stuff
hide-version idl/8.0
module-version python/3.11.3 3.11
module-alias python3 python/3.11.3
}

As can be seen in the example above, one can hide the display of the module in module avail command (which CHPC does by default on older program versions), and, more usefully for an user, create a custom version or alias to the module, which is especially useful to shorten long version names or create a custom name for a given version.

CHPC's global custom file, which is used to hide deprecated modules, shorten versions and set aliases to commonly used modules, is in /uufs/chpc.utah.edu/sys/modulefiles/etc/rc .

Customizing the default user environment via .bashrc/.tcshrc

CHPC has streamlined its approach to customizing user environments. As mentioned before, CHPC strongly discourages the modification of .bashrc/.tcshrc files. This is because any time CHPC releases new versions of these files, often users will have their shell environment broken by the changes. CHPC has provided the custom.sh and custom.csh files for users to customize their environment. The user should have copied these files already (or started with them in a new user account).  After copying, these files should work seamlessly with the .bashrc/.tcshrc. The user is free to make any modifications they want in the custom scripts. As a convenience, a means for modifying environments on a cluster specific basis is also given in the custom script.

Setting up command aliases

Users can create a .aliases file in their home directory to set up any command aliases that they want to have defined in their working environment. If this file exists, it will automatically be sourced upon login by the .tcshrc/.bashrc file.

Setting up Modules

CHPC has implemented modules on all of its clusters in 2015 to improve the user experience and to align with other national computing centers which are using modules. 

While the CHPC users have the choice to adopt the module environment or to remain with the script sourcing method that has been used in the past, most have switched to the use of environment modules.  All new users accounts are started with the module option.  We keep this modules setup section for those who still have not migrated but wish to do so.

In order to implement the modules existing CHPC users will have to replace their current script sourcing based .bashrc and .tcshrc files as outlined below. 

To enable modules, the user will need to copy the CHPC bashrc and tcshrc to their home directory:

cp /uufs/chpc.utah.edu/sys/modulefiles/templates/bashrc ~/.bashrc
cp /uufs/chpc.utah.edu/sys/modulefiles/templates/tcshrc ~/.tcshrc

To set up the default CHPC environment, users will also need to copy the custom.sh and custom.csh scripts

cp /uufs/chpc.utah.edu/sys/modulefiles/templates/custom.sh ~/.custom.sh
cp /uufs/chpc.utah.edu/sys/modulefiles/templates/custom.csh ~/.custom.csh

Existing CHPC users may want to make backup copies of their existing .tcshrc or .bashrc if they have particular modifications which they would like to preserve. After copying the .bashrc/.tcshrc, the user will need to log out and log in. After this, the user should be able to use modules. Users should not modify the .bashrc/.tcshrc; instead, place all custom shell environment in custom.sh/csh. Users may create a ".aliases" file if they desire, which will be automatically sourced by the .bashrc/.tcshrc. CHPC strongly discourages users from setting environment variables in ".aliases"; the file should only contain alias commands.

Note: Bash users should ensure that the .bash_profile file is present in $HOME.

Last Updated: 1/13/25