Modules

Z Komputery Dużej Mocy w ACK CYFRONET AGH
Wersja z dnia 14:38, 17 wrz 2019 autorstwa Noga (dyskusja | edycje)
(różn.) ← poprzednia wersja | przejdź do aktualnej wersji (różn.) | następna wersja → (różn.)
Skocz do:nawigacja, szukaj

Package description

Lmod package provides easy and dynamic modification of shell variables adjusting it for the specific requirements of a given software package. For each ot the software packages available on the cluster there is corresponding module defined (or modules if more than one version of the package is available). Name of a module is built according to scheme program-name/version. For libraries the scheme is libs/library-name/version, and for tools (eg. programming languages such as R or Python) tools/library-name/version. For both software packages and libraries, the newest version is default, so the last part version can be omitted. Changes are made using module command and a parameter defining the action.

Procect site: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod

Project documentation: https://lmod.readthedocs.io/

Frequently used options:

  • module add <module> or module load <module> – load the program module
  • module rm <module> or module unload <module> – remove the program module


  • module list – show list of currently loaded modules
  • module avail – show list of all available modules
  • module avail <software_name> – show all versions of given software_name


  • module purge – remove all loaded modules
  • module show <module> or module display <module> – show information about given module
  • module swap <module-1> <module-2> – exchange modules in shell


  • module save [collection-name] - save loaded modules into default collection or collection named collection-name
  • module restore [collection-name] - loadmodules from default collection or named collection
  • module savelist - list saved collections
  • module describe [collection-name] - list modules in collection named collection-name


  • module use /path/to/personal/modulefiles - add modules from folder /path/to/personal/modulefiles to available modules
  • module unuse /path/to/personal/modulefiles - remove modules from folder /path/to/personal/modulefiles from list of available modules


  • module help - help for module command

Examples of use

  • Load the latest version of Intel compiler
module add intel
  • Load Intel compiler version 19.0.5
module add intel/19.0.5
  • List all available versions of Intel compilers
module avail intel
  • Exchange OpenMPI Ethernet version for the Infiniband version
module switch openmpi/1.4.3-intel-11.1-eth openmpi/1.4.3-intel-11.1-ib
  • Remove paths of the Intel compiler version 10.0 from the environment
module rm intel/10.0

Using your own modules (Advanced)

Modules package allows also creating your own modules in (TCL or https://en.wikipedia.org/wiki/Lua_(programming_language) Lua]). Your own modules should be stored in directory, which could be added to module listing with module use /path/to/personal/modulefiles command. You can get more information about creating modules on the project site.

Example of module written in Lua

-- -*- lua -*-
local pkgName     = myModuleName()
local fullVersion = myModuleVersion()

whatis("Name: "..pkgName)
whatis("Version "..fullVersion)
whatis("Category: apps/chemistry")
whatis("Description: Molcas@UU 8.0 (v.15-06-18) quantum chemistry chemistry package")
whatis("URL: http://www.kvant.kemi.uu.se/molcas/index.html")
whatis("Keyword: QC, chemistry")

-- add path to Molcas to PATH environmental variable and set MOLCAS environmental variable 
prepend_path('PATH','/net/archive/groups/plg******/software/molcas.uu.8/molcas-8.0-15.06.18_CentOS_7.0_x86_64/bin')
setenv('MOLCAS', '/net/archive/groups/plg******/software/molcas.uu.8/molcas-8.0-15.06.18_CentOS_7.0_x86_64')
add_property("state","testing")

require "math"

--  set Molcas scratch dir accordingly to SLURM environment 
if (os.getenv('SLURM_JOB_ID') ~= nil) then
  setenv('MOLCAS_WORKDIR', os.getenv('SCRATCHDIR'))
else
  setenv('MOLCAS_WORKDIR', os.getenv('SCRATCH'))
end