Difference between revisions of "Modules Guide"

From Storrs HPC Wiki
Jump to: navigation, search
(Loading Modules on Log-in)
 
Line 28: Line 28:
 
  module initadd {module name}
 
  module initadd {module name}
 
If you decide that you no longer want a specific module to be loaded every time, simply remove that line from your ~/.bashrc under the  "'''<tt># Load saved modules</tt>'''" heading.
 
If you decide that you no longer want a specific module to be loaded every time, simply remove that line from your ~/.bashrc under the  "'''<tt># Load saved modules</tt>'''" heading.
 +
 +
Be care when you use '''initadd'''.  If you run it multiple times, it can install conflicting software in your ~/.bashrc.  You'll should probably inspect your ~/.bashrc for conflicting modules if you use '''initadd''' frequently.
  
 
=Making Your Own Module Files=
 
=Making Your Own Module Files=

Latest revision as of 14:26, 13 June 2019

What is Modules?

Environment Modules (referred to as just Modules) is the system the cluster uses to select which software to use. It also allows you to choose which version if multiple versions of a given software exist. Modules does this by adding software paths to your environment PATH variable.

Viewing Modules

To view all available modules run the command:

module avail

This will list out the applications that you can load into your environment.

To view already loaded programs, run the command:

module list

Loading Your Environment

To load a module run:

module load {MODULE_NAME}

Where your module name is one from the list of available modules. Note that tab completion works for the names of modules.

Some modules have conflicts, because different versions of the same program cannot be loaded at the same time. To check for conflicts view your modules list that is loaded. If something conflicts run the command:

module unload {MODULE_NAME}

You can then load the required module

Loading Modules on Log-in

If you wish for certain modules to be loaded every time you log in, To do this run:

module initadd {module name}

If you decide that you no longer want a specific module to be loaded every time, simply remove that line from your ~/.bashrc under the "# Load saved modules" heading.

Be care when you use initadd. If you run it multiple times, it can install conflicting software in your ~/.bashrc. You'll should probably inspect your ~/.bashrc for conflicting modules if you use initadd frequently.

Making Your Own Module Files

A user can create their own module files, to load environment variables and paths. Create a directory in your home directory called privatemodules. This is where you will store your module files. The convention for creating module files is making a directory with the name of the application and a text file with the version number. For example, if you wanted a module file for gcc version 4.1.2, the directory would be:

~/privatemodules/gcc

and the file name would be 4.1.2 Below is a sample module file for GCC version 4.1.2 . You can use this as a basic template.


File content:

#%Module1.0#####################################################################
##
##gcc 4.1.2  modulefile
##
##Module to set up GCC 4.1.2
##
module-whatis "GCC 4.1.2"

conflict gcc
 
prepend-path    PATH                    /usr/local/pkg/gcc/4.3.6
prepend-path    LD_LIBRARY_PATH         /usr/lib/gcc/x86_64-redhat-linux/4.1.2
prepend-path    MANPATH                 /usr/share/man/


Notice a conflict is defined, so only one version of GCC can be loaded at a time. The environment variables are defined with the path they were installed to. Specific programs may require other environment variables. In this case the basic template is:

prepend-path   {VARIABLE NAME}         {PATH}

After saving this file, you may load it the same as with the cluster module files. Make sure you do not create a module with the same name as one already created. For example, if gcc/4.1.2 is taken, but you would like a user version of this, create gcc/4.1.2-1

Troubleshooting

For any errors, please read FAQ first.