Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Table of Contents

The HPC cluster system at the University of Iowa has many software packages installed and sometimes different versions of the same package. These software programs are installed in several different directories. These software packages are made available for use via environment modules. See Argon Software List - HPC Documentation - UIowa Wiki for the software installed on Argon.

Like previous generation UI HPC systems, Argon uses environment modules for managing the shell environment needed by software packages. Argon uses LMod rather than the TCL modules used in previous generation UI HPC systems. More information about Lmod can be found in the Lmod: A New Environment Module System. Briefly, Lmod provides improvements over TCL modules in some key ways. One is that Lmod will automatically load and/or swap dependent environment modules when higher level modules are changed in the environment. It can also temporarily deactivate modules if a suitable alternative is not found, and can reactivate those modules when the environment changes back. We are not using all of the features that Lmod is capable of so the modules behavior should be very close to previous systems but with a more robust way of handling dependencies.

The software packages are built as sets, called "stacks". Each stack provides a set of software packages with a self-consistent set of dependencies. This scheme allows us to keep multiple versions of software packages, each with a consistent set of dependencies with other packages in that set. This can make switching versions of a particular package a little more challenging but the best way to address that situation is to load a different stack in a different ssh session. 

Why use modules

Using modules allows one to set the appropriate environment variables needed for the respective software program. Often, this is simply adding the program to the $PATH variable, but software containing libraries and headers will also set $LD_LIBRARY_PATH and $CPATH. Any other variable that the software may need can be set and so the contents of the modules can be fairly simple or complex.

There are several advantages to using environment modules to set up your environment.

  1. ease of use
  2. ability to revert to your previous environment
  3. ability to easily switch your environment to try different versions of a program

To view the modules that you currently have loaded

Note
titleDefault Software stack

If you have a default module set, it will be loaded at login time. Otherwise, a system default will be loaded. The system default has historically been the "legacy" stack. Beginning with the Fall 2022 Maintenance, November 2, 2022, the system default stack will be set to load the 2021.1 stack. If you need to use modules from the legacy stack then it will need to be explicitly loaded before loading module files.

No Format
module load stack/legacy

Note that the naming scheme of the legacy stack is different so the names of modules that you wish to use may have changed, typically to all lower case but hyphenation could also be different. More information on the software stacks can be found on the Argon Software List page.


Table of Contents

The HPC cluster system at the University of Iowa has many software packages installed and sometimes different versions of the same package. These software programs are installed in several different directories. These software packages are made available for use via environment modules. See Argon Software List - HPC Documentation - UIowa Wiki for the software installed on Argon.

Like previous generation UI HPC systems, Argon uses environment modules for managing the shell environment needed by software packages. Argon uses LMod rather than the TCL modules used in previous generation UI HPC systems. More information about Lmod can be found in the Lmod: A New Environment Module System. Briefly, Lmod provides improvements over TCL modules in some key ways. One is that Lmod will automatically load and/or swap dependent environment modules when higher level modules are changed in the environment. It can also temporarily deactivate modules if a suitable alternative is not found, and can reactivate those modules when the environment changes back. We are not using all of the features that Lmod is capable of so the modules behavior should be very close to previous systems but with a more robust way of handling dependencies.

The software packages are built as sets, called "stacks". Each stack provides a set of software packages with a self-consistent set of dependencies. This scheme allows us to keep multiple versions of software packages, each with a consistent set of dependencies with other packages in that set. This can make switching versions of a particular package a little more challenging but the best way to address that situation is to load a different stack in a different ssh session. 

Why use modules

Using modules allows one to set the appropriate environment variables needed for the respective software program. Often, this is simply adding the program to the $PATH variable, but software containing libraries and headers will also set $LD_LIBRARY_PATH and $CPATH. Any other variable that the software may need can be set and so the contents of the modules can be fairly simple or complex.

There are several advantages to using environment modules to set up your environment.

  1. ease of use
  2. ability to revert to your previous environment
  3. ability to easily switch your environment to try different versions of a program

To view the modules that you currently have loaded

Panel
titlemodule list
Currently Loaded Modules:
  1) intel/2017.4            4) ipp/2017.4   7) parallel_studio/2017.4  10) xz/5.2.3
  2) daal/2017.4             5) mkl/2017.4   8) bzip2/1.0.6             11) zlib/1.2.11
  3) intel_debugger/2017.4   6) tbb/2017.4   9) jdk/8u121               12) openmpi/2.1.2_parallel_studio-2017.4

...

Note that if there are multiple versions in the module directory and no default is listed, the modules program will try to load the latest version that it finds. This may not be what you want. To avoid surprises, you should specify the entire module name and version. If there is only one version in a module directory then the module version does not have to be specified, it will load the only version it finds. However, you should still specify the entire name and version to avoid surprises when a second version is added at a later point in time. It is often the case that you need to reference the path to the software managed by the module, such as specifying directory paths while compiling software. There is a special variable set in every module file that points to the root directory of the installation. The nomenclature pattern is like ROOT_MODULENAME. For example, the zlib module sets $ROOT/1.2.11 module sets this:

ROOT_ZLIB=/opt/apps/zlib/1.2.11

...

That will save the loaded modules as the default set. To restore that run

No Format
module restore

In addition to Note that the above command will restore your modules to the system default if you do not have a default module set saved. In addition to saving/restoring a default set you can also assign a name to the collection and save multiple collections.

...

The default module set generally represents a set of modules that meet all of your needs and/or provide a starting point for loading other modules. This is particularly important for Argon, which uses independent stacks of software. Once you have your workflow worked out you can save a default set of modules, as described above. That set will include a specific "stack" module as well. This allows you to maintain consistency of the environment for your jobs.

Info

The After the April 2021 HPC maintenance, the default module set, if you have one, will be loaded by default. If there is no default module set, a default stack module will be loaded. Since your default module set will be loaded automatically, you should remove a "module restore" command from your shell startup file, such as ~/.bashrc, as it is not necessary and will just duplicate what is done by default. 


As the default stack module loaded at startup is changed over time, having Having a default module set ensures that your module environment will stay the same over time. You can then verify your jobs with a new stack and then update the default module set when you are ready.

Using environment modules with SGE jobs and qlogin

For qsub jobs, if you have not overridden the default SGE parameters then the entire environment is passed to the job. This is because the -V qsub flag is set in the default request. Since environment modules set up the environment then the environment set up by the modules will be passed. Since the list of the loaded modules is also part of the environment then the list of loaded modules will be passed as well. However, the above does not apply to qlogin sessions as that creates a fresh environment. See the Qlogin for Interactive Sessions - HPC Documentation - UIowa Wiki page for more information.

However, the recommendation for qsub jobs is to include the module load statements in your job script and not depend on the environment passed in from the submit host. That way, setting up the needed environment is part of the job and is thus more reproducible. If depending on loading modules before qsub then you have to remember to get the environment set up before job submission. When loading modules in your job script, it is best to use module sets. If you would prefer to make sure that the module loads are more explicit then make sure to do a 

No Format
module purge

...

Resetting modules

After you have loaded modules over time you may want to clean up the environment a bit. You can unload individual modules but often you will simply want to reset. You could run module purge to clean out all modules but that will also remove the stack module. You would then need to reload a stack module to make program modules available again.

No Format
module purge
module load stack/???

Using module purge is probably not what you want. If you have default module set then you can reset to that by simply running

No Format
module restore

If you wish to clear out the environment even more then you could run

No Format
module restore system

or

module reset

to reset to the default system modules, ignoring your default module set. If you do not have a default module set then any of the following

No Format
module restore
module restore system
module reset

will restore the module state to the system default.

Using environment modules with SGE jobs and qlogin

qlogin

For qsub jobs, if you have not overridden the default SGE parameters then the entire environment is passed to the job. This is because the -V qsub flag is set in the default request. Since environment modules set up the environment then the environment set up by the modules will be passed. Since the list of the loaded modules is also part of the environment then the list of loaded modules will be passed as well. However, the above does not apply to qlogin sessions as that creates a fresh environment. See the Qlogin for Interactive Sessions - HPC Documentation - UIowa Wiki page for more information.

standard qsub

The recommendation for "standard" qsub jobs is to include the module load statements in your job script and not depend on the environment passed in from the submit host. That way, setting up the needed environment is part of the job and is thus more reproducible. If depending on loading modules before qsub then you have to remember to get the environment set up before job submission. When loading modules in your job script, it is best to use module sets. If you would prefer to make sure that the module loads are more explicit then make sure to do a 

No Format
module purge

before any "module load ..." commands. 

High Throughput Computing (HTC) and/or High Volume Computing (HVC)

If your jobs are High Throughput Computing (HTC) and/or High Volume Computing (HVC) jobs, it is advised to not load modules per job but rather use the submission environment. The reason is that many thousands of jobs will need to do a large number of module loads in relatively short time frames, which could cause failures. For HTC/HVC type jobs, carefully load the modules that you will need for the jobs prior to job submission. The loaded modules are part of the environment so they will get passed to the job, unless you have overridden the default. Do not load any modules or module sets in the job script, although you may want to have comments regarding what modules are in use. Do not load any modules or module sets in your ~/.bashrc file. Finally, disable the default module set if you have one.