Modules en.: Różnice pomiędzy wersjami
Linia 2: | Linia 2: | ||
==Package description== | ==Package description== | ||
− | + | '''[https://www.tacc.utexas.edu/research-development/tacc-projects/lmod 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 <tt>program-name/version</tt>. For libraries the scheme is <tt>libs/library-name/version</tt>, and for tools (eg. programming languages such as R or Python) <tt>tools/library-name/version</tt>. For both software packages and libraries, the newest version is default, so the last part <tt>version</tt> can be omitted. Changes are made using <tt>module</tt> command and a parameter defining the action. | |
− | Procect site: | + | Procect site: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod |
− | Project documentation: | + | |
− | + | Project documentation: https://lmod.readthedocs.io/ | |
===Frequently used options:=== | ===Frequently used options:=== | ||
* <tt>module add <module></tt> or <tt>module load <module></tt> – load the program module | * <tt>module add <module></tt> or <tt>module load <module></tt> – load the program module | ||
* <tt>module rm <module></tt> or <tt>module unload <module></tt> – remove the program module | * <tt>module rm <module></tt> or <tt>module unload <module></tt> – remove the program module | ||
+ | |||
+ | |||
* <tt>module list</tt> – show list of currently loaded modules | * <tt>module list</tt> – show list of currently loaded modules | ||
* <tt>module avail</tt> – show list of all available modules | * <tt>module avail</tt> – show list of all available modules | ||
* <tt>module avail <software_name></tt> – show all versions of given <tt>software_name</tt> | * <tt>module avail <software_name></tt> – show all versions of given <tt>software_name</tt> | ||
+ | |||
+ | |||
* <tt>module purge</tt> – remove all loaded modules | * <tt>module purge</tt> – remove all loaded modules | ||
* <tt>module show <module></tt> or <tt>module display <module></tt> – show information about given module | * <tt>module show <module></tt> or <tt>module display <module></tt> – show information about given module | ||
− | * <tt>module | + | * <tt>module swap <module-1> <module-2></tt> – exchange modules in shell |
+ | |||
+ | |||
+ | *<tt>module save [collection-name]</tt> - save loaded modules into default collection or collection named <tt>collection-name</tt> | ||
+ | *<tt>module restore [collection-name]</tt> - loadmodules from default collection or named collection | ||
+ | *<tt>module savelist</tt> - list saved collections | ||
+ | *<tt>module describe [collection-name]</tt> - list modules in collection named <tt>collection-name</tt> | ||
+ | |||
+ | |||
+ | *<tt>module use /path/to/personal/modulefiles</tt> - add modules from folder <tt>/path/to/personal/modulefiles</tt> to available modules | ||
+ | *<tt>module unuse /path/to/personal/modulefiles</tt> - remove modules from folder <tt>/path/to/personal/modulefiles</tt> from list of available modules | ||
+ | |||
+ | |||
+ | *<tt>module help</tt> - help for <tt>module</tt> command | ||
===Examples of use=== | ===Examples of use=== | ||
Linia 23: | Linia 40: | ||
module add intel | module add intel | ||
</pre> | </pre> | ||
− | * Load Intel compiler version | + | * Load Intel compiler version 19.0.5 |
<pre> | <pre> | ||
− | module add intel/ | + | module add intel/19.0.5 |
</pre> | </pre> | ||
* List all available versions of Intel compilers | * List all available versions of Intel compilers | ||
Linia 41: | Linia 58: | ||
===Using your own modules (Advanced) === | ===Using your own modules (Advanced) === | ||
− | Modules package allows creating your own modules | + | Modules package allows also creating your own modules in ([https://en.wikipedia.org/wiki/Tcl 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 <tt>module use /path/to/personal/modulefiles</tt> command. You can get more information about creating modules on the project site. |
+ | |||
+ | ====Example of module written in Lua==== | ||
+ | <syntaxhighlight lang="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 | ||
+ | </syntaxhighlight> |
Aktualna wersja na dzień 14:38, 17 wrz 2019
Spis treści
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