Next revision
|
Previous revision
|
using_software_modules [2020/06/28 18:21] deadline created |
using_software_modules [2021/04/28 14:36] (current) brandonm [Quick Start] Word, spelling, and formatting fixes |
=====Using Software Modules===== | =====Using Software Modules===== |
| |
Many HPC systems support multiple libraries and library versions. For instance by default, HPC Limulus systems support both Open MPI and MPICH, each of these packages provides the Message Passing Interface (MPI) API for programmers and applications. These libraries are supplied as an RPM package as part of the [[https://openhpc.community/|OpenHPC distribution]]. | Many HPC systems support multiple libraries and library versions. For instance, by default, HPC Limulus systems support both Open MPI (Message Passing Interface) and MPICH. Each of these packages provides the MPI API for programmers and applications. These libraries are supplied as RPM packages as part of the [[https://openhpc.community/|OpenHPC distribution]]. |
| |
To help manage multiple packages on a cluster, the [[https://lmod.readthedocs.io/en/latest/|lmod package]] is a convenient way to dynamically change the users’ environment through //modulefiles//. This includes easily adding or removing directories to the PATH environment variable. Modulefiles for Library packages provide environment variables that specify where the library and header files can be found. | To help manage multiple packages on a cluster, the [[https://lmod.readthedocs.io/en/latest/|lmod package]] is a convenient way to dynamically change the users’ environment through //modulefiles//. This includes easily adding or removing directories to or from the PATH environment variable. Modulefiles for library packages provide environment variables that specify where the library and header files can be found. |
| |
Thus, a user can quickly move between various library "environments" by simply using the lmod package. | Thus, a user can quickly move between various library "environments" by simply using the lmod package. |
| |
All OpenHPC or Limulus user libraries install with pre-configured modulefiles. System administrators can create modulefiles for custom packages that are built and installed outside of the OpenHPC or Limulus RPM trees. | All OpenHPC or Limulus user libraries are installed with pre-configured modulefiles. System administrators can create modulefiles for custom packages that are built and installed outside of the OpenHPC or Limulus RPM trees. |
| |
====Simple Example==== | ====Simple Example==== |
| |
All Linux distributions come with GNU C compilers. While the versions of these compilers is "current" tehey are usually not "new" and may not support some advanced processors and offer better optimization. For instance, the current version of OpenHPC installs version 8.3 GNU compilers (C, C++, Fortran) in ''/opt/ohpc/pub/compiler/gcc/8.3.0/bin''. It does not replace the existing "distribution" compilers (version 4.8.5) located in ''/usr/bin'' | All Linux distributions come with GNU C compilers. While the versions of these compilers are "current" they are usually not "new" and may not support some advanced processors or offer better optimization. For instance, the current version of OpenHPC installs version 8.3 GNU compilers (C, C++, Fortran) in ''/opt/ohpc/pub/compiler/gcc/8.3.0/bin''. It does not replace the existing "distribution" compilers (version 4.8.5) located in ''/usr/bin''. |
| |
By default OpenHPC uses modules to point to the version 8.3 GNU compilers. This setting can be confirmed by entering: | By default, OpenHPC uses modules to point to the version 8.3 GNU compilers. This setting can be confirmed by entering: |
| |
<code> | <code> |
| |
<code> | <code> |
gcc --version | $ gcc --version |
gcc (GCC) 8.3.0 | gcc (GCC) 8.3.0 |
Copyright ... | Copyright ... |
| |
<code> | <code> |
$module rm gnu8 | $ module rm gnu8 |
| |
Inactive Modules: | Inactive Modules: |
</code> | </code> |
| |
Ignoring the "Inactive Module" message for the moment, the path and version of the default GNU compilers can be shown as follows: | Ignoring the "Inactive Modules" message for the moment, the path and version of the default GNU compilers can be shown as follows: |
| |
<code> | <code> |
====Quick Start==== | ====Quick Start==== |
| |
The following are some quick examples of hos the ''module'' command is used. | The following are some quick examples of how the ''module'' command is used. |
| |
===What Modules are Available==== | ===What Modules are Available==== |
| |
<code> | <code> |
module avail | $ module avail |
| |
----------------------------------------------- /opt/ohpc/pub/moduledeps/gnu8 ----------------------------------------------- | ----------------------------------------------- /opt/ohpc/pub/moduledeps/gnu8 ----------------------------------------------- |
===Swap the MPI Libaries=== | ===Swap the MPI Libaries=== |
| |
The folling example check the path to the current ''mpicc'' wrapper function and then swaps the MPI version from Open MPI to MPICH. | The following example checks the path to the current ''mpicc'' wrapper function and then swaps the MPI version from Open MPI to MPICH. |
<code> | <code> |
$ which mpicc | $ which mpicc |
/opt/ohpc/pub/mpi/openmpi3-gnu8/3.1.4/bin/mpicc | /opt/ohpc/pub/mpi/openmpi3-gnu8/3.1.4/bin/mpicc |
| |
$ module swap openmpi3 mpich/3.3.1 | $ module swap openmpi3 mpich/3.3.1 |
| |
$ which mpicc | $ which mpicc |
/opt/ohpc/pub/mpi/mpich-gnu8-ohpc/3.3.1/bin/mpicc | /opt/ohpc/pub/mpi/mpich-gnu8-ohpc/3.3.1/bin/mpicc |
</code> | </code> |