Environment Module Usage
The Environment Modules tool is used on HPC platforms to manage environment variables for applications.
Environment Modules are tools that simplify shell initialisation by allowing users to easily modify their environment during a session using modulefiles. Each modulefile contains the information needed to configure the shell for the application. Module files can be shared by many users on a system, and users can have their own collections to supplement or replace shared module files.
Module Basic commands
module avail/ava # show available modules.
module list # show loaded modules
module load/add compilers/gcc-13.1.0 # load module AAA
module unload/rm compilers/gcc-13.1.0 # unload module
module purge # unload all loaded tools
module show gcc/13.1.0 # view the appropriate configuration information
Examples of module usage:
List Available Modules
$ module avail
---------------/usr/local/Modules/modulefiles ------------------------------------------------------------------------------------------------------
compilers/gcc-13.1.0 dot lammps/2022-serial mpi/mpich-4.1.2 mpi/mvapich2-2.3.7-1 null
compilers/icc-2023.1.0 gromacs/2023.2 module-git mpi/mpich-4.1.2_icc-2023.1.0 mpi/mvapich2-2.3.7-1_icc-2023.1.0 R/4.3.1
compilers/icc32-2023.1.0 intelmpi-2021.9.0 module-info mpi/mvapich-3.0b mpi/openmpi-4.1.5 use.own
compilers/mkl-2023.1.0 lammps/2022-parallel modules mpi/mvapich-3.0b_icc-2023.1.0 mpi/openmpi-4.1.5_icc-2023.1.0 vasp/6.3.2
Load gcc13.1
$ module load compilers/gcc-13.1.0
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/compilers/gcc/131/libexec/gcc/x86_64-pc-linux-gnu/13.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/opt/compilers/gcc/131 --enable-threads=posix -enable-checking=release -enable-languages=c,c++ -disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (GCC)
List loaded modules
$ module list
Currently Loaded Modulefiles:
1) compilers/gcc-13.1.0
Unload gcc13.1 modules
$ module unload compilers/gcc-13.1.0
Viewing the module configuration for gcc 13.1
$ module show compilers/gcc-13.1.0
------------------------------------------------------------------
/usr/local/Modules/modulefiles/compilers/gcc-13.1.0
prepend-path PATH /opt/compilers/gcc/131/bin
prepend-path LD_LIBRARY_PATH /opt/compilers/gcc/131/lib:/opt/compilers/gcc/131/lib64
------------------------------------------------------------------