Environment Modules (EM)
What are Environment Modules (EMs)
The "Environment Module" system is a tool that allows you to control your own access to the different pieces of software that are currently installed on the cluster. This is important because we often have many different versions of the same software installed, and accessing the wrong version could create bugs that would be difficult to track down. EMs give you a way to access the software you need, while also avoiding any unnecessary conflicts.
In Unix, access to programs and libraries is generally controlled by setting a number of "environment variables". On many systems, users need to setup these variables themselves by editing certain scripts that get run automatically when the user logs in. Environment Modules simplify this process by allowing you to type some simple commands to query, load and unload software as you need it. To use a particular software package, you have to load the relevant module. Some info about EMs can be found in the wikipedia page : https://en.wikipedia.org/wiki/Environment_Modules_(software).
Initializing and Loading EMs
There are some standard software and libraries that are already installed for all user on the cluster. Users can see which of these are currently available (Note. Some modules may be removed and/or updated, it is important that you always check to make sure the software/library you want to use is available) by using the following command:
module avail
This will show:
-----------------------------/cm/local/modulefiles---------------------------
..........
.some package_1
.some package_2
.use.own
...........
----------------------------/cm/shared/modulefiles--------------------------
............
.some more packages
............
The use.own
is a special module, it enables the user to load their own
modules for software they have installed locally inside their home
directory. For more information about how to install software and create
modules for them please see the wiki page:Installing User Packages In ARGO.
Users can load a specific module from the list of available modules by invoking:
module load module_name
You must load the respective module for the software or a library before
using it inside your application. You can load modules inside your
sbatch
script by using the above command. You can check which modules
are currently loaded by:
module list
To get information about a particular module (such as the collection of environment variables that are set by that module) you can use:
module show module_name
You can unload a module by:
module unload module_name
To find more options type in:
module --help
Auto Loading Modules at Login
Users can make a module load automatically each time they login to the cluster using the following command:
module initadd module_name
Similarly one can remove a module from being auto loaded by:
module initrm module_name
You may also get more information about a particular module by invoking:
module whatis module_name
Note. Whatever modules you need to run your
application must also be loaded from your sbatch
Slurm job submission
script which you submit to the Slurm scheduler in order to run your
application.
#SBATCH options
....
....
#load modules after this line
Reference
- Linux manpage: http://linux.die.net/man/1/module