Configure the Development Environment with Modules

How to list and load various modules for the development environment.

Each modulefile contains information needed to configure the shell for an application. Once the Modules package is initialized, the environment can be modified on a per-module basis using the module command. Typically modulefiles instruct the module command to alter or set shell environment variables such as $PATH, $MANPATH, etc. Modulefiles may be shared by many users on a system, and users may have their own collection to supplement or replace the shared modulefiles.

Add or remove modulefiles from the current environment as needed. The environment changes contained in a modulefile can be summarized through the module command as well. If no arguments are given, a summary of the module usage and subcommands are shown. The action for the module command to take is described by the subcommand and its associated arguments.

After logging in, load the desired collection of modules by running the following command:
module restore <collection_name>
To switch between the different module collections at anytime, run the module restore command.
Note: Do not load/unload cpe-<compiler> modules. Instead, use the module restore command.

List Loaded Modules

user@system037:~> module list
Currently Loaded Modulefiles:
 1) cpe-cray
 2) cce/11.0.1(default)                   
 3) cce-sve/10.0.1(default)   
 4) craype/2.6.6(default)     
 5) craype-arm-nsp1
 6) craype-network-infiniband
 7) cray-libsci/20.08.1.1(default)
 8) perftools-base/20.10.0(default)
 9) cray-mvapich2_nogpu_svealpha/2.3.4(default)

List Available Module Collections

List all available module collections:
user@system037:~> module savelist
 1) PrgEnv-cray

List Available Modules

List all available modules:
user@system037:~> module avail
List all available modules of a certain type (for example module avail cce):
user@system037module avail cce

--------------------------------------------------------------------------------- /opt/cray/pe/modulefiles ----------------------------------------------------------------------------------
cce-sve/10.0.0(default)

Load Modules

Load the default version of a module:
user@system037:~> module load cce
Load a specific version of a module:
user@system037:~> module load cce/version

Unload Modules

Remove a module:
user@system037:~> module unload cray-libsci

Change Module Versions

Swap out the default module for a specific version:
user@system037:~> module switch cce cce/version

Change Programming Environments

To restore module collections, use module restore to unload one collection and restore the other.
user@system037:~> module restore PrgEnv-gnu

Show Module Information

Display information about module conflicts and links:
user@system037:~> module show perftools
-------------------------------------------------------------------
/opt/cray/pe/perftools/20.08.0/modulefiles/perftools:

prereq          perftools-base
conflict        perftools
conflict        perftools-lite
conflict        perftools-lite-sample
conflict        perftools-lite-events
conflict        perftools-lite-loops
conflict        perftools-lite-gpu
conflict        perftools-lite-hbm
conflict        perftools-preload
setenv          CRAYPAT_COMPILER_OPTIONS 1
setenv          CRAYPAT_SUBMODULE_VARS CRAYPAT_COMPILER_OPTIONS
-------------------------------------------------------------------

Swap Other Programming Environment Components

Note that products which contain dynamically linked libraries, such as MPI, switching the module environment does not completely change the run time environment because the dynamic libraries are cached by the runtime linker, as specified by /etc/ld.so.conf. To use a nondefault version of a dynamic library at run time, prepend CRAY_LD_LIBRARY_PATH to LD_LIBRARY_PATH.

The following commands revert the environment to an earlier version of cray-mvapich2:

$ user@login> module swap cray-mvapich2_nogpu_svealpha/2.3.4 cray-mvapich2_nogpu_svealpha/2.3.3pre2
$ export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}