Skip to content

Software

Betty uses Lmod (Lua Modules) to organize and activate scientific software by modifying your environment (e.g., PATH, LD_LIBRARY_PATH, etc.). Use the short ml helper for convenience.

Software categories (examples)

  • Compilers: GNU, NVIDIA, Intel, CUDA Toolkit
  • MPI stacks: Open MPI, Intel MPI (oneAPI), NVIDIA HPC-X
  • Math/IO libraries: Intel MKL, BLAS, FFTW, HDF5
  • Commercial (licensed): Molpro, Gaussian 16
  • Open access: Quantum ESPRESSO, Julia, Bowtie, RELION, …

Tip: avoid mixing toolchains (e.g., don’t load Intel MPI with GCC-built libraries unless intended). Prefer matching stacks (GCC+OpenMPI, Intel+Intel MPI, etc.).


Basic Lmod commands

List all available modules (long):

module avail
ml av

Search for a module (and see requirements/versions):

ml spider gcc
ml spider gcc/13.3.0

Load modules into your environment:

module load gcc              # loads site default gcc
ml openmpi/4.1.6             # loads a specific Open MPI

Show what you have loaded right now:

ml
module list

Unload everything (clean slate):

ml purge # Remember to load the slurm module again

Show full details of a module (env vars, dependencies, etc.):

ml show gcc

Restore the site default module collection:

ml restore

Saving & restoring your module collections

If you routinely use the same set of modules, save them as a collection.

Example session:

ml gcc openmpi/4.1.6 anaconda3 julia slurm
ml

Currently Loaded Modules might show something like:

  1) gcc/13.3.0      3) anaconda3/2023.09-0   5) slurm/23.11.10
  2) openmpi/4.1.6   4) julia/1.11.5

Save as the default collection:

ml save

Save with a custom name:

ml save MyModules

Restore later:

ml restore           # restores the "default" collection
ml restore MyModules # restores your named collection

Private modulefiles (per-user modules)

You can create your own modulefiles for software you installed in your home or project space.

1) Create a personal modulefiles directory

mkdir -p $HOME/modulefiles

2) Add it to your MODULEPATH (so Lmod can find your modules)

ml use $HOME/modulefiles

You only need to do this once per session. To make it automatic, add the same line to ~/.bashrc (or your shell’s startup file).

3) Create a directory for your module name and a versioned Lua file
Example: a custom Intel oneAPI 5.0.1 wrapper

mkdir -p $HOME/modulefiles/myoneapi501
nano $HOME/modulefiles/myoneapi501/5.0.1.lua

4) Put this content into 5.0.1.lua (edit paths for your install):

-- -*- lua -*-
-- MY version of Intel oneAPI 5.0.1

whatis("Name: intel")
whatis("Version: 5.0.1")
whatis("Target: cascadelake")
whatis("Short description: OneAPI 5.0.1 precompiled.")

-- Load environment by sourcing Intel setvars on module load
execute{cmd="source /vast/projects/jcombar1/testing/Junk/Intel/setvars.sh", modeA={"load"}}

5) Load your private module

ml use $HOME/modulefiles
ml load myoneapi501/5.0.1

If you later save a collection (see above) while this module is loaded, it will be included in your saved collection.


Quick troubleshooting notes

  • If ml spider shows a module but ml load fails, check version spelling and conflicts (Lmod will usually suggest a fix).
  • After big changes, ml purge and reload your stack in order (compiler → MPI → libraries → apps).
  • If you built software yourself, ensure its bin/ and lib/ paths are exported (your modulefile is a good place to do that).