Environment Modules

You already know that when you type a command on a cluster, bash searches for it in the locations listed in the PATH environment variable. Similarly, when programs need to load libraries, they would be searched for in locations listed in LIBRARY_PATH and/or LD_LIBRARY_PATH environment variables.

If locations for all the software packages installed on a cluster were added to those lists, they would be several pages long, and it would take time to search through all these locations. Also, at times (different) users need different versions of the same software, thus different locations will have to be listed in the *PATH environment variables depending on which version is needed. To help users manage their environment we use Environment Modules. When a user loads a module for a specific version of a software package, appropriate changes are made to the user's environment, such as adding new locations in the *PATH environment variables. When package is no longer needed, users can unload the module from their environment.

Some software packages depend on other software. In this case loading module for the package may load modules for the other software as well. For example, if you issue "module load r" (so that you could use R), and then "module list" command, you will see a long list of modules loaded in your environment.

"module purge" command will unload all modules from user's environment. To see the list of all available modules, issue "module spider" command.

 

Next: SLURM