Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
excludeCommands available

Loading and Unloading modules

module load

Load a module into the current environment of the session or job.

No Format
$ module load git
load git 2.20.1 (git_DIR, GIT_VERSION, PATH)


Tip

Note that Lmod knows if it is already loaded, and will actually swap unload the old one and load the new one (swapping them)

No Format
$ module load git/new
unload git 2.20.1 (git_DIR, GIT_VERSION, PATH)
load git 2.25.1 (git_DIR, GIT_VERSION, PATH)

The following have been reloaded with a version change:
  1) git/2.20.1 => git/2.25.1


...

No Format
$ module swap git/new
unload git 2.20.1 (git_DIR, GIT_VERSION, PATH)
load git 2.25.1 (git_DIR, GIT_VERSION, PATH)

The following have 
The following have been reloaded with a version change:
  1) git/2.20.1 => git/2.25.1

module unload

No Format
$ module unload git
unload git 2.25.1 (git_DIR, GIT_VERSION, PATH)

module

...

reset

Restore the system default modules. It effectively resets the environment to the system default for a fresh session.Run this to see what a module would do without loading it. It is very useful to discover what environment variables will be defined so you can use them later on.

No Format
$ module list

Currently showLoaded git
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   /usr/local/apps/modulefiles/lmod/core/git/2.20.1.lua:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
setenv("git_DIR","/usr/local/apps/git/2.20.1")
setenv("git_VERSION","2.20.1")
setenv("GIT_VERSION","2.20.1")
prepend_path("PATH","/usr/local/apps/git/2.20.1/bin")
LmodMessage("show git 2.20.1 (git_DIR, GIT_VERSION, PATH)")
whatis("Git is a free and open source distributed version control system.")
help([[Git is a free and open source distributed version control system. It is designed to handle everything from small to very large projects with speed and efficiency. For more information on all the available commands run git --help or visit https://git-scm.com/ ]])

module list

See what modules are loaded at any point.

No Format
$ module list

Currently Loaded Modules:
  1) git/2.20.1
Tip

Note that Lmod will also mark what modules are loaded when running module avail (with an L next to them)

...

Modules:
  1) gcc/8.3.1   2) prgenv/gnu   3) git/2.26.0   4) cmake/3.16.5

 

$ module reset
Resetting modules to system default. Reseting $MODULEPATH back to system default. All extra directories will be removed from $MODULEPATH.
$ module list

Currently Loaded Modules:
  1) gcc/8.3.1   2) prgenv/gnu

module purge

Unload all modules.

Note

This will also unload default modules such as prgenv, and you may need to load them again to see a more complete module tree. Use of module reset is normally preferred.


No Format
$ module list

Currently Loaded Modules:
  1) git/2.20.1   2) cmake/3.16.5

$ module purge
$ module list
No modules loaded

Listing and Searching

module list

See what modules are loaded at any point.

No Format
$ module list

Currently Loaded Modules:
  1) git/2.20.1


Tip

Note that Lmod will also mark what modules are loaded when running module avail (with an L next to them)


Tip

Module list can take an argument to list only those module that match an argument

No Format
$ module list

Currently Loaded Modules:
  1) git/2.20.1   2) cmake/3.16.5

$ module list git

Currently Loaded Modules Matching: git
  1) git/2.20.1


module avail

List all modules that can be loaded at any point.

Warning

module avail will not show all the possible modules, but only those that can be loaded in the current environment. To see all possible modules and their versions, use module spider


No Format
$ module avail

-------------------------------------------------------------------------------------- Global Aliases ---------------------------------------------------------------------------------------
   pa -> prgenv/amd    pe -> prgenv/expert    pg -> prgenv/gnu    pi -> prgenv/intel    pp -> prgenv/pgi

--------------------

Module list can take an argument to list only those module that match an argument

No Format
$ module list

Currently Loaded Modules:
  1) git/2.20.1   2) cmake/3.16.5

$ module list git

Currently Loaded Modules Matching: git
  1) git/2.20.1

module avail

List all modules that can be loaded at any point.

Warning

module avail will not show all the possible modules, but only those that can be loaded in the current environment. To see all possible modules and their versions, use module spider

No Format
$ module avail

----------------------------------------------------- /usr/local/apps/modulefiles/lmod/prgenvs --------------------------------- Global Aliases ---------------------------------------------------------------------------------------
   pa -> prgenv/amd    pe -> prgenv/expert    pg -> prgenv/gnu    pi ->
   prgenv/amd (a)    prgenv/expert (E,e)    prgenv/gnu (D:g)    prgenv/intel (i)   pp -> prgenv/pgi

------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/prgenvscompilers --------------------------------------------------------------------------
   prgenv/amd (a)aocc/2.1.0    gcc/4.8.5    prgenv/expertgcc/8.4.0 (E,eD)    prgenv/gnugcc/9.3.0 (D:gnew)    prgenv/intel (iintel/18.0.4    intel/19.0.5 (D)    prgenvpgi/pgi19.10

--------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/compilerscore ---------------------------------------------------------------------------
   aoccaec/2.1.0.3    gcc/4.8.5    gcc/8.4.0 (D)   eigen/3.3.7      gccgit/92.3.0 (new20.1           (L,D)    intel-mkl/18.0.4        intellua/195.03.5 (D)       pginco/19.10

--------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/core ---------------------------------------------------------------------------
   aec/1.04.7.8         proj/6.1.1          valgrind/3.14.0
   antlr/2.7.7         fcm/2019.05.0    git/2.25.1           (new)    intel-mkl/19.0.5 (D)    maven/3.6.3           eigen/3.3.7ninja/1.10.0      gitproj4/5.2.20.10
           (L,D)    intel-mkl/18.0cmake/3.13.4        luaferret/7.5.3.50        nco/4.7.8gnuparallel/20190122          projjasper/62.10.114           valgrindmodulemgr/32.14.0
    antlropenjpeg/2.73.70    python3/3.6.8-01
     fcmcmake/20193.05.016.5 (D)    gitgeos/23.257.1       gsl/2.5    (new)    intel-mkl/19.0.5 (D)    maven/3.6.3      ninja/1.10.0      proj4java/511.2.0
0.6     cmake/3.13.4        ferretnccmp/71.8.52.01     gnuparallel/20190122patchelf/0.10          jasperudunits/2.02.1426

  Where:
   L:      modulemgr/2.0  Module  openjpeg/2.3.0is loaded
    python3/3.6.8-01
E:   cmake/3.16.5 (D)    geos/3.7.1Experimental
   Aliases:  Aliases exist: gslfoo/1.2.53 (1.2) means that "module load foo/1.2" will load foo/1.2.3
   D:        Default Module

Use  java/11.0.6             nccmp/1.8.2.1    patchelf/0.10     udunits/2.2.26

  Where:
   L:        Module is loaded
   E:        Experimental
   Aliases:  Aliases exist: foo/1.2.3 (1.2) means that "module load foo/1.2" will load foo/1.2.3
   D:        Default Module

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys"."module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".


Tip

You may filter the output by providing a search pattern

No Format
$ module avail git

-------------------------------------------------------------------------------------- Global Aliases ---------------------------------------------------------------------------------------
   pa -> prgenv/amd    pe -> prgenv/expert    pg -> prgenv/gnu    pi -> prgenv/intel    pp -> prgenv/pgi

Tip

You may filter the output by providing a search pattern

No Format
$ module avail git

-------------------------------------------------------------------------------------- Global Aliases/usr/local/apps/modulefiles/lmod/core ---------------------------------------------------------------------------------------
   pa -> prgenv/amd    pe -> prgenv/expert    pg -> prgenv/gnu    pi -> prgenv/intel    pp -> prgenv/pgi

----------------------------git/2.20.1 (L,D)    git/2.25.1 (new)

  Where:
   L:        Module is loaded
   Aliases:  Aliases exist: foo/1.2.3 (1.2) means that "module load foo/1.2" will load foo/1.2.3
   D:        Default Module

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".



Tip

You may use the -d option to only list the default version for each module

No Format
$ module -d avail

----------------------------------------------- /usr/local/apps/modulefiles/lmod/core ---------------------------------------- Global Aliases ---------------------------------------------------------------------------------------
   pa -> git/2.20.1 (L,D)prgenv/amd    pe -> git/2.25.1 (new)

  Where:
   L:prgenv/expert    pg -> prgenv/gnu    pi     Module is loaded
   Aliases:  Aliases exist: foo/1.2.3 (1.2) means that "module load foo/1.2" will load foo/1.2.3
   D:        Default Module

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

Tip

You may use the -d option to only list the default version for each module

No Format
$ module -d avail

-> prgenv/intel    pp -> prgenv/pgi

------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/prgenvs --------------------------------------------------------------------------
   prgenv/gnu (g)

------------------------------------------------------------------------ /usr/local/apps/modulefiles/lmod/compilers -------------------------------------------------------------------------
   aocc/2.1.0    gcc/8.4.0    intel/19.0.5    pgi/19.10

---------------------------------------------------------------------------------------- Global Aliases --- /usr/local/apps/modulefiles/lmod/core ------------------------------------------------------------------------------------

   aec/1.0.3   pa -> prgenv/amd    pe -> prgenv/experteigen/3.3.7    pg -> prgenv/gnugeos/3.7.1      pi -> prgenv/intel    pp -> prgenv/pgi

------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/prgenvs --------------------------------------------------------------------------
   prgenv/gnu (g)

------------------------------------------------------------------------ /usr/local/apps/modulefiles/lmod/compilers -------------------------------------------------------------------------
   aocc/2.1.0    gcc/8.4.0    intel/19.0.5    pgi/19.10

--------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/core ---------------------------------------------------------------------------
   aec/1.0.3           eigen/3.3.7      geos/3.7.1                  gsl/2.5             java/11.0.6    modulemgr/2.0    ninja/1.10.0      proj/6.1.1          udunits/2.2.26
   antlr/2.7.7         fcm/2019.05.0    git/2.20.1           (L)    intel-mkl/19.0.5    lua/5.3.5      nccmp/1.8.2.1    openjpeg/2.3.0    proj4/5.2.0         valgrind/3.14.0
   cmake/3.16.5 (L)    ferret/7.5.0     gnuparallel/20190122        jasper/2.0.14       maven/3.6.3    nco/4.7.8        patchelf/0.10     python3/3.6.8-01

  Where:
   L:        Module is loaded
   Aliases:  Aliases exist: foo/1.2.3 (1.2) means that "module load foo/1.2" will load foo/1.2.3

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

module whatis

Show a short description of the module

No Format
$ module whatis git
git/2.20.1          : Git is a free and open source distributed version control system.

module help

Show a longer description and useful information of the module.

     gsl/2.5             java/11.0.6    modulemgr/2.0    ninja/1.10.0      proj/6.1.1          udunits/2.2.26
   antlr/2.7.7         fcm/2019.05.0    git/2.20.1           (L)    intel-mkl/19.0.5    lua/5.3.5      nccmp/1.8.2.1    openjpeg/2.3.0    proj4/5.2.0         valgrind/3.14.0
   cmake/3.16.5 (L)    ferret/7.5.0     gnuparallel/20190122        jasper/2.0.14       maven/3.6.3    nco/4.7.8        patchelf/0.10     python3/3.6.8-01

  Where:
   L:        Module is loaded
   Aliases:  Aliases exist: foo/1.2.3 (1.2) means that "module load foo/1.2" will load foo/1.2.3

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".


module spider (new)

List all possible modules, including those that are not visible because they belong to other environments.

No Format
$ module spider

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The following is a list of the modules and extensions currently available:
----------------------------------------------------------------------------------------------------
No Format
$ module help git

--------------------------------------------------------------------------- Module Specific Help for "git/2.20.1" ---------------------------------------------------------------------------
Git is a free and open source distributed version control system. It is designed to handle everything from small to very large projects with speed and efficiency. For more information on all the available commands run git --help or visit https://git-scm.com/

module spider (new)

List all possible modules, including those that are not visible because they belong to other environments.


  aec: aec/1.0.3

  antlr: antlr/2.7.7

  aocc: aocc/2.1.0

  boost: boost/1.61.0:gnu:4.8.5, boost/1.61.0:gnu:8.4, boost/1.61.0:gnu:9.3, boost/1.61.0:intel:19.0, boost/1.61.0

...

You may also enquire for a particular module to see all the versions:

No Format
$ module spider fftw

---------
No Format
$ module spider

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The following is a list of the modules and extensions currently available fftw:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  aec   Versions: aec/1.0.3


     antlr: antlr/2.7.7

  aocc: aocc/2.1.0

  boost: boost/1.61.0:fftw/3.3.8:gnu:4.8.5, boost/1.61.0
        fftw/3.3.8:gnu:8.4, boost/1.61.0
        fftw/3.3.8:gnu:9.3, boost/1.61.0
        fftw/3.3.8:intel:19.0, boost/1.61.0
        fftw/3.3.8

...

You may also enquire for a particular module to see all the versionsAnd even more detailed information about a package version in particular:

No Format
$ module spider fftw/3.3.8

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  fftw: fftw/3.3.8
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    You will need to  Versions:
        load all module(s) on any one of the lines below before the "fftw/3.3.8:gnu:4.8" module is available to load.

        fftwgcc/34.3.8:gnu:8.45
        fftwgcc/38.3.8:gnu:9.34.0
        fftwgcc/39.3.8:intel:19.0
        fftwintel/319.30.85

...

And even more detailed information about a package version in particular:

 
    Help:
      A fast, free C FFT library; includes real-complex, multidimensional, and parallel transforms. For more information visit http://www.fftw.org/ 


Discovery

module whatis

Show a short description of the module

No Format
$ module whatis git
git/2.20.1          : Git is a free and open source distributed version control system.

module help

Show a longer description and useful information of the module.

No Format
$ module help git

No Format
$ module spider fftw/3.3.8

----------------------------------------------------------------------------------------- Module Specific Help for "git/2.20.1" ---------------------------------------------------------------------------
Git is a free and open source distributed version control system. It is designed to handle everything from small to very large projects with speed and efficiency. For more information on all the available commands run git --help or visit https://git-scm.com/

module show

Run this to see what a module would do without loading it. It is very useful to discover what environment variables will be defined so you can use them later on.

No Format
$ module show git
--------------------------------------------
  fftw: fftw/3.3.8
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    You will need to load all module(s) on any one of the lines below before the "fftw/3.3.8" module is available to load.

      gcc/4.8.5
      gcc/8.4.0
      gcc/9.3.0
      intel/19.0.5
 
    Help:
      A fast, free C FFT library; includes real-complex, multidimensional, and parallel transforms. For more information visit http://www.fftw.org/ 


module purge

Unload all modules

No Format
$ module list

Currently Loaded Modules:
  1) git/2.20.1   2) cmake/3.16.5

$ module purge
unload cmake 3.16.5 (CMAKE_DIR, CMAKE_VERSION, PATH
unload git 2.20.1 (git_DIR, GIT_VERSION, PATH)

----------------------------
   /usr/local/apps/modulefiles/lmod/core/git/2.20.1.lua:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
setenv("git_DIR","/usr/local/apps/git/2.20.1")
setenv("git_VERSION","2.20.1")
setenv("GIT_VERSION","2.20.1")
prepend_path("PATH","/usr/local/apps/git/2.20.1/bin")
LmodMessage("show git 2.20.1 (git_DIR, GIT_VERSION, PATH)")
whatis("Git is a free and open source distributed version control system.")
help([[Git is a free and open source distributed version control system. It is designed to handle everything from small to very large projects with speed and efficiency. For more information on all the available commands run git --help or visit https://git-scm.com/ ]])

Collections

Tip

The default collection is great to define your default modules you want loaded when you start your session or job.

Lmod introduces the concept of collections. A user can define groups of modules that can be saved and easily restored by name. If no name is specified when saving or restoring a collection, it will use a default collection.

module save 

Tip

If you want to save not only modules but their specific versions or tags, you must load those modules with their full name or tag.

Save the current list of modules as a collection.

If you want to create a new collection, make sure you start from a clean set with module purge and load only those modules you require before you save them.

No Format
$ module purge
$ module load git cmake
$ module save
Saved current collection of modules to: "default", for system: "tems"

Those modules will be loaded automatically for any new session or job.

And to create a named collection:

No Format
$ module load git
$ module save mycollection
Saved current collection of modules to: "mycollection", for system: "tems"

module restore

You can restore a collection at any point. It will unload the necessary modules and load the ones in the collection. If no argument is specified, it will reload your default collection.

No Format
$ module restore mycollection
Restoring modules from user's mycollection, for system: "tems"

module savelist

See all the collections that are available for the user on this system

No Format
$ module savelist
Named collection list (For LMOD_SYSTEM_NAME = "tems"):
  1) default  2) mycollection

module describe

Show the contents of a collection

No Format
$ module describe
Collection "default" contains: 
   1) git    2) cmake

$ module describe mycollection 
Collection "mycollection" contains: 
   1) git

module disable

Disable a collection. 

No Format
$ module disable mycollection
Disabling mycollection collection by renaming with a "~"
$ module savelist
Named collection list (For LMOD_SYSTEM_NAME = "tems"):
  1) default

The ml shortcut

...

Lmod provides a convenience shortcut command called ml that doubles up as module list or any other mode:

No Format
$ ml

Currently Loaded Modules:
  1) git/2.20.1
 
$ ml git/new
unload git 2.20.1 (git_DIR, GIT_VERSION, PATH)
load git 2.25.1 (git_DIR, GIT_VERSION, PATH)

The following have been reloaded with a version change:
  1) git/2.20.1 => git/2.25.1

$ ml

Currently Loaded Modules:
  1) git/2.25.1

$ ml -git
$
$ ml whatis git
git/2.25.1          : Git is a free and open source distributed version control system.

It also provides shorter subcommands such as "av" for "avail". See the modules --help for more details.