Updated 2021-05-17

Modules Guide

Features Universal to All PACE Systems

Display Module File

  • To display the commands in a module file use module show <module name>

    • For example, to show module info for the python module:
module show python 
  • To display all available modules in scope, use
module avail

RHEL7 Features

RHEL7 systems use Lmod modules.

Set Default Modules on Login

  • The module save command enables a user to set default modules that will be loaded when they log in.
  • After you have logged in, load the module you want to add to the defaults with module load <module name>. Then run module save
  • Module Save creates the file ~/.lmod.d/default, and adds all the defaults to it:

  • For example, to add Anaconda3 to the default modules loaded upon login:

  • Login

  • module load anaconda3
  • `module save # creates ~/.lmod.d/default

  • To reset the default modules

rm ~/.lmod.d/default

RHEL6 Features

RHEL6 systems use Tcl-based Environment Modules.

Set Default Modules on Login

You can place modules that you want to be automatically loaded each time you login in the .pacemodules file in your home directory There are two ways to do this:

  1. You can open the file in a text editor and add all the modules you want to load on login at once. Make sure to add each module with module load <module name> on each line.
  2. You can add a module that you want to load on startup with echo "module load <module name>" >> .pacemodules

Create Private Modules

The modules system allows users to create and use modules in private directories. The following steps outline how to create private modules:

  1. Make the directory for storing personal modules
    • mkdir ~/privatemodules
  2. Create an empty module inside that directory
    • cp /etc/modulefiles/empty ~/privatemodules/empty
  3. Load the system-module that allows personal module use
    • module load use.own
  4. Check that private modules are now supported
    • module avail
    • The privatemodules section should list the "empty" module
  5. Create your own modules
    • Look at the module files in /etc/modulefiles/ for examples of how to create modules.
    • User-defined environment variable can be added using setenv VAR /where/to/find/it