Difference between revisions of "Modules"
(28 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:Software]][[Category: | + | [[Category:Software]][[Category:Infrastructure]] |
+ | {|align=right | ||
+ | |__TOC__ | ||
+ | |} | ||
==Introduction== | ==Introduction== | ||
− | + | Setting and maintaining your environment while running a large number of diverse software applications with different requirements can be a daunting task. The Research Computing is adopting the ''modules'' system developed by Robert McLay at the Texas Advanced Computing Center [http://www.tacc.utexas.edu/home (TACC)] in order to ease the complexity of this process and relieve users of this burden. | |
+ | |||
+ | ==Basic usage== | ||
+ | See '''[[Modules Basic Usage]]''' for a short practical introduction to using ''modules''. | ||
+ | |||
+ | ==Module Command== | ||
+ | There is no executable called 'module' in Lmod. The 'module' command or its 'ml' alias, which you can use interactively are enabled when you <code>source /etc/profile.d/modules.sh</code> shell script inside another script or shell environment. It's done automatically for interactive sessions, but if you need access to 'module load' in a script running in a scheduled job source the above script first. Support for other shells and programming languages like python or R is also available (“sh”, “csh”, “perl”, “python”, “lisp”, “fish”, “cmake”, or “r”). See documentation for details. | ||
+ | |||
+ | ==Personal modules== | ||
+ | You can write and use your own modulefiles. The procedure for making them available is very simple. For example, if you'd like to create version 1.0 of the module 'mymod' pick any directory you own, say ~/modules: | ||
+ | * Create a personal module directory, and a 'mymod' module directory | ||
+ | mkdir ~/modules | ||
+ | mkdir ~/modules/mymod | ||
+ | * Add a modulefile | ||
+ | touch ~/modules/mymod/1.0.lua | ||
+ | |||
+ | Note that you can copy any modulefile we have in /apps/lmod/modulefiles to serve as a starting point for your 'mymod/1.0.lua' modulefile. <br> | ||
+ | To test/use the new module run the following command, or add it to your ~/.bashrc file: | ||
+ | module use ~/modules | ||
+ | |||
+ | The ''"myapp/1.0"'' module should be available for your use. | ||
+ | |||
+ | ==Loading modules with Python== | ||
+ | If you need to load an environment module from python set the sys.path to the Lmod installation on HPG. E.g. | ||
+ | <pre> | ||
+ | import os, sys | ||
+ | sys.path.insert(0,"/apps/lmod/lmod/init/") | ||
+ | from env_modules_python import module | ||
+ | module("load","somemodule/version") | ||
+ | </pre> | ||
+ | |||
+ | ==Support== | ||
+ | To request help with using modules or installation of new module enabled application please file a [https://support.rc.ufl.edu support request]. | ||
+ | |||
==Upstream Documentation== | ==Upstream Documentation== | ||
− | Those who would like to learn as much as possible about lmod can use | + | Those who would like to learn as much as possible about lmod can use this [http://lmod.readthedocs.io/en/latest/ documentation]. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | There is a well-written article on Lmod in the [http://www.admin-magazine.com/HPC/Articles/Lmod-Alternative-Environment-Modules?utm_source=ADMIN+Newsletter&utm_campaign=HPC_Update_31_Lmod_Alternative_to_Environment_Modules_2013-01-30 HPC Admin Magazine]. | |
− | |||
− | |||
− | |||
− | |||
− | is a | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 18:21, 7 February 2023
Introduction
Setting and maintaining your environment while running a large number of diverse software applications with different requirements can be a daunting task. The Research Computing is adopting the modules system developed by Robert McLay at the Texas Advanced Computing Center (TACC) in order to ease the complexity of this process and relieve users of this burden.
Basic usage
See Modules Basic Usage for a short practical introduction to using modules.
Module Command
There is no executable called 'module' in Lmod. The 'module' command or its 'ml' alias, which you can use interactively are enabled when you source /etc/profile.d/modules.sh
shell script inside another script or shell environment. It's done automatically for interactive sessions, but if you need access to 'module load' in a script running in a scheduled job source the above script first. Support for other shells and programming languages like python or R is also available (“sh”, “csh”, “perl”, “python”, “lisp”, “fish”, “cmake”, or “r”). See documentation for details.
Personal modules
You can write and use your own modulefiles. The procedure for making them available is very simple. For example, if you'd like to create version 1.0 of the module 'mymod' pick any directory you own, say ~/modules:
- Create a personal module directory, and a 'mymod' module directory
mkdir ~/modules mkdir ~/modules/mymod
- Add a modulefile
touch ~/modules/mymod/1.0.lua
Note that you can copy any modulefile we have in /apps/lmod/modulefiles to serve as a starting point for your 'mymod/1.0.lua' modulefile.
To test/use the new module run the following command, or add it to your ~/.bashrc file:
module use ~/modules
The "myapp/1.0" module should be available for your use.
Loading modules with Python
If you need to load an environment module from python set the sys.path to the Lmod installation on HPG. E.g.
import os, sys sys.path.insert(0,"/apps/lmod/lmod/init/") from env_modules_python import module module("load","somemodule/version")
Support
To request help with using modules or installation of new module enabled application please file a support request.
Upstream Documentation
Those who would like to learn as much as possible about lmod can use this documentation.
There is a well-written article on Lmod in the HPC Admin Magazine.