Difference between revisions of "Modules Basic Usage"

From UFRC
Jump to navigation Jump to search
m
 
(30 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Modules]]
+
[[Category:Essentials]]
 +
{|align=right
 +
  |__TOC__
 +
  |}
 
Back to [[Modules]].
 
Back to [[Modules]].
=Basic Usage=
 
 
The minimal information required for using a standalone application at UFRC:
 
The minimal information required for using a standalone application at UFRC:
 
  module
 
  module
will output help information on running the module command. The module help includes all information described below.
+
will output help information on running the module command. The module help includes all information described below. You can also view [http://lmod.readthedocs.io/en/latest/010_user.html the User Guide to Lmod] for the upstream documentation.
 +
{|
 +
|-
 +
|style="width: 50%;"|
 +
 
 
==Loading a module==
 
==Loading a module==
* If you already know the name of the module, the only command needed to load the latest or the default version of the module and be able to execute the software is 'module load <application>'. For instance, if the module is called '''ncbi_blast''', run the following command
+
If you already know the name of the module, the only command needed to load the latest or the default version of the module and be able to execute the software is 'module load <application>'. For instance, if the module is called '''ncbi_blast''', run the following command
 
  module load ncbi_blast
 
  module load ncbi_blast
<span style="background:red">Please Note:</span> If you are working on a project and would like to continue using the same software versions when we update the software and the latest/default module version may change you should use module versions in your load commands. For example, use
+
||
module load ncbi_blast/2.2.28
+
||
instead of '<code>module load ncbi_blast</code>' to continue using NCBI BLAST version 2.2.28 after we update the software.
+
||
  
 
==Unloading a module==
 
==Unloading a module==
* To remove a module, so its environment gets cleared run
+
All modules are automatically unloaded when you log out of the HPC system, and in most cases, there is no need to use the unload command.<br>
 +
To manually remove a module, so its environment gets cleared run  
 
  module unload ncbi_blast
 
  module unload ncbi_blast
All modules are automatically unloaded when you log out of the HPC system, and in most cases, there is no need to use the unload command.
+
|}
 +
{{Note|It is recommended that you include a specific version when you load a module.  This is so that, when we update the default version available in the environment module, the version you are using will not change ''unexpectedly'' and potentially break your workflow.<br>
 +
An example of the recommended way to load modules would be: <code>module load ncbi_blast'''/2.2.28'''</code> |warn}}
 +
{{Note | If you already have one (or more) modules loaded and you receive a message like <code>Lmod is automatically replacing "somemodule/1.0" with "anothermodule/2.0"</code> when you try to load another module, it means that the two environment modules have conflicting dependencies. <br>
 +
You will need to separate your workflow so that you you complete all of the steps for "somemodule", then do a "module purge", and then "module load anothermodule/2.0".| info}}
  
==Showing loaded modules==
+
==Showing information about modules==
 +
{|
 +
|-
 +
|style="width: 35%;"|
 +
module whatis app
 +
*shows info about a module such as name, version, category, upstream url, and a short description.
 +
||
 +
||
 +
module spider app/version
 +
*shows a longer description and information on what versions are available, as well as what other modules have to be loaded first.
 +
||
 +
||
 
  module list
 
  module list
will show all currently active (loaded) modules.
+
*shows all modules you currently have active (loaded).
 +
|}
 +
 
 
==Finding a module==
 
==Finding a module==
module spider
+
When you need to find out whether a program is already installed user either 'module spider' to search through the module names or 'module keyword' to search through module description, tags, and keywords.
is a great time saver as it allow you to traverse the entire list of available modules along with short descriptions of the applications they make available.  
+
 
 +
E.g. this command will find pbsmrtpipe, smrtsv2, and also the pacbio (smrtlink tools) module, which module spider will not find.
 +
module keyword smrt
 +
 
 
A much more concise, but context specific table of available modules can be obtained with
 
A much more concise, but context specific table of available modules can be obtained with
 
  module avail
 
  module avail
The "module avail" command shows all currently accessible branches of the global tree of modules, which depend on what compiler and MPI implementation modules are loaded. The ''core'' branch is always shown, but we also have ''compiler'' (intel/10.1 and intel/11.1) and mpi (mvapich/0.9.9, mpich2/1.0.8, mvapich2/1.4.1, openmpi/1.2.7, and openmpi/1.3.4 in the intel/10.1 branch as well as mvapich2/1.5.1, openmpi/1.3.4, and openmpi/1.4.3 in the intel/11.1 branch) implementation specific and even python version specific branches of the module tree. The top line at each section shown by 'module avail' shows exactly what loaded module is responsible for enabling that branch of the module tree. Sometimes, to be able to load a module that you find using "module spider" you might have to go through the sequential steps of loading the respective branches. For instance, if you need to load the module for the "espresso" software that was built with MVAPICH2 support  using Intel Compiler version 11.1 you would run
+
The "module avail" command shows all currently accessible branches of the global tree of modules, which depend on what compiler and MPI implementation modules are loaded. The ''core'' branch is always shown, but we also have various version branches for compiler and mpi, implementation specific, and even python. The top line at each section shown by 'module avail' shows exactly what loaded module is responsible for enabling that branch of the module tree. <br>
 +
Sometimes, to load a module that you find using "module spider" you might have to go through the sequential steps of loading the respective branches. E.g., if you need to load the module for the "espresso" software that was built with MVAPICH2 support  using Intel Compiler version 11.1 you would run
 
  module load intel/11.1 mvapich2 expresso
 
  module load intel/11.1 mvapich2 expresso
  
==Showing information about a module==
 
module whatis app
 
will show a short listing of module specific information such as name, version, category, upstream url, and a short description.
 
module spider app
 
or
 
module spider app/version
 
will show you the long description and the information on what versions are available for a particular application.
 
 
==Swapping branches==
 
==Swapping branches==
 
To switch between different compiler and MPI implementation of a particular app or to gain access to a module that belongs to a particular branch run the following command to swap the old for the new branch
 
To switch between different compiler and MPI implementation of a particular app or to gain access to a module that belongs to a particular branch run the following command to swap the old for the new branch
 
  module swap old new
 
  module swap old new
or if you loaded a particular version
+
  module swap old/version new/version      #this is if you loaded a specific version
  module swap old/version new/version
 
 
If multiple versions of a particular app/version are available module will automatically reload those modules when you swap the branches, so you could seamlessly switch between a single-threaded version of an app you used for testing and an mpi version that will be used for a large-scale computing job.
 
If multiple versions of a particular app/version are available module will automatically reload those modules when you swap the branches, so you could seamlessly switch between a single-threaded version of an app you used for testing and an mpi version that will be used for a large-scale computing job.
 +
 +
==Managing Module Collections==
 +
A very useful feature of Lmod is to save and restore custom collections of modules with <code>module save</code> and <code>module restore</code> as described in the [http://lmod.readthedocs.io/en/latest/010_user.html#user-collections user collections] section of the User Guide. See the contents of a collection with <code>module describe</code> and show a list of your collections with <code>module savelist</code>.

Latest revision as of 16:07, 13 February 2023

Back to Modules. The minimal information required for using a standalone application at UFRC:

module

will output help information on running the module command. The module help includes all information described below. You can also view the User Guide to Lmod for the upstream documentation.

Loading a module

If you already know the name of the module, the only command needed to load the latest or the default version of the module and be able to execute the software is 'module load <application>'. For instance, if the module is called ncbi_blast, run the following command

module load ncbi_blast

Unloading a module

All modules are automatically unloaded when you log out of the HPC system, and in most cases, there is no need to use the unload command.
To manually remove a module, so its environment gets cleared run

module unload ncbi_blast
It is recommended that you include a specific version when you load a module. This is so that, when we update the default version available in the environment module, the version you are using will not change unexpectedly and potentially break your workflow.
An example of the recommended way to load modules would be: module load ncbi_blast/2.2.28
If you already have one (or more) modules loaded and you receive a message like Lmod is automatically replacing "somemodule/1.0" with "anothermodule/2.0" when you try to load another module, it means that the two environment modules have conflicting dependencies.
You will need to separate your workflow so that you you complete all of the steps for "somemodule", then do a "module purge", and then "module load anothermodule/2.0".

Showing information about modules

module whatis app
  • shows info about a module such as name, version, category, upstream url, and a short description.
module spider app/version
  • shows a longer description and information on what versions are available, as well as what other modules have to be loaded first.
module list
  • shows all modules you currently have active (loaded).

Finding a module

When you need to find out whether a program is already installed user either 'module spider' to search through the module names or 'module keyword' to search through module description, tags, and keywords.

E.g. this command will find pbsmrtpipe, smrtsv2, and also the pacbio (smrtlink tools) module, which module spider will not find.

module keyword smrt

A much more concise, but context specific table of available modules can be obtained with

module avail

The "module avail" command shows all currently accessible branches of the global tree of modules, which depend on what compiler and MPI implementation modules are loaded. The core branch is always shown, but we also have various version branches for compiler and mpi, implementation specific, and even python. The top line at each section shown by 'module avail' shows exactly what loaded module is responsible for enabling that branch of the module tree.
Sometimes, to load a module that you find using "module spider" you might have to go through the sequential steps of loading the respective branches. E.g., if you need to load the module for the "espresso" software that was built with MVAPICH2 support using Intel Compiler version 11.1 you would run

module load intel/11.1 mvapich2 expresso

Swapping branches

To switch between different compiler and MPI implementation of a particular app or to gain access to a module that belongs to a particular branch run the following command to swap the old for the new branch

module swap old new
module swap old/version new/version       #this is if you loaded a specific version

If multiple versions of a particular app/version are available module will automatically reload those modules when you swap the branches, so you could seamlessly switch between a single-threaded version of an app you used for testing and an mpi version that will be used for a large-scale computing job.

Managing Module Collections

A very useful feature of Lmod is to save and restore custom collections of modules with module save and module restore as described in the user collections section of the User Guide. See the contents of a collection with module describe and show a list of your collections with module savelist.