Lmod

De NLHPC

Lmod es un sistema de módulos que permite cargar software para la ejecución en el clúster. La mayoría del software ya se encuentra compilado y optimizado para su ejecución en las diversas arquitecturas disponibles, pero si necesitara software no incluido, por favor, comuníquenoslo mediante un correo a Soporte. A continuación se presenta una guía básica para su uso habitual.

Tenga en cuenta que por defecto se carga el módulo intel, ya que casi todo el software está compilado con dicho compilador. Si no desea usar por defecto dicho compilador, debería ejecutar ml purge para limpiar el entorno de variables (ver sección Limpiar).

El comando module y ml pueden usarse indistintamente. La segunda forma se utiliza para abreviar y es la que se usará en este tutorial.

Listar y Buscar

El comando ml o ml list lista todos los módulos que estén cargados. El comando ml av o ml avail lista todo el software disponible. La mayoría del software disponible está compilado con el compilador Intel para optimizar su ejecución en nuestra arquitectura computacional.

$ ml av

----------------- /home/lmod/modules/all/MPI/intel/2019.2.187-GCC-8.2.0-2.31.1/impi/2019.2.187 -----------------
   ANTLR/2.7.7-Python-3.7.2                 MPFR/4.0.2                           bzip2/1.0.6
   APR-util/1.6.1                           Mako/1.0.7-Python-2.7.15             cURL/7.64.0
   APR/1.6.5                                Mesa/18.3.4                          cairo/1.16.0
   Autoconf/2.69                     (D)    Meson/0.49.2-Python-3.7.2            expat/2.2.6
   Automake/1.16.1                   (D)    NAMD/2.13-mpi                 (D)    flex/2.6.4                    (D)
   Autotools/20180311                (D)    NAMD/2.13-smp-mpi                    fontconfig/2.13.1
   BAGEL/1.2.2                              NASM/2.14.02                         freeglut/3.0.0
   Bison/3.0.5                              NCL/6.6.2                            freetype/2.9.1
   Bison/3.3                         (D)    NCO/4.7.9                            g2clib/1.6.0
   Boost/1.64.0                             NLopt/2.5.0                          g2lib/1.4.0
   Boost/1.69.0-Python-2.7.15               Ninja/1.9.0                          gc/7.6.8
   Boost/1.69.0                      (D)    ORCA/4.1.1-OpenMPI-3.1.3             gettext/0.19.8.1              (D)
   Bowtie/1.2.2                             OpenFOAM/v1812                       git/2.21.0
   Bowtie2/2.3.4.3                          OpenMPI/3.1.3                        gperf/3.1
   CDO/1.9.6                                OpenMPI/4.0.0                        grib_api/1.28.0
   CESM-deps/2                              OpenMPI/4.0.1                 (D)    help2man/1.47.8               (D)
   CGAL/4.13-Python-2.7.15                  PCRE/8.42                            hopspack/2.0.2
   CGAL/4.13                         (D)    PLUMED/2.5.0                         hwloc/2.0.3                   (D)
   CMake/3.13.4                      (D)    PROJ/5.2.0                           imkl/2019.2.187               (L)
   CP2K/7.0                                 ParaView/5.4.1-mpi                   intltool/0.51.0-Perl-5.28.1
   Doxygen/1.8.15                           Perl/5.28.1                          libGLU/9.0.0
   ELPA/2018.11.001                         Pillow/5.4.1-Python-3.7.2            libQGLViewer/2.7.1
   ESMF/7.1.0r                              PnetCDF/1.9.0                        libconfig/1.7.2
   ESyS-Particle/2.3.5-Python-2.7.15        Pylint/1.9.4-Python-2.7.15           libdap/3.19.1

[ETC...]

Para buscar si está disponible un software, use ml spider y un nombre a buscar:

$ ml spider openfoam
-----------------------------------------------------------------------------------
  OpenFOAM: OpenFOAM/v1812
-----------------------------------------------------------------------------------

    Description:
      OpenFOAM is a free, open source CFD software package. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics and
      electromagnetics. 


    You will need to load all module(s) on any one of the lines below before the "OpenFOAM/v1812" module is available to load.

      icc/2019.2.187-GCC-8.2.0-2.31.1  impi/2019.2.187
      ifort/2019.2.187-GCC-8.2.0-2.31.1  impi/2019.2.187

Mostrar

Muestra información específica de una aplicación en particular.

$ ml spider OpenFOAM/v1812
 
 --------------------------------------------------------------------------------------------------------------------------
   OpenFOAM: OpenFOAM/v1812
 --------------------------------------------------------------------------------------------------------------------------

    Description:
      OpenFOAM is a free, open source CFD software package. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions,
      turbulence and heat transfer, to solid dynamics and electromagnetics. 
 
    You will need to load all module(s) on any one of the lines below before the "OpenFOAM/v1812" module is available to load.

      icc/2019.2.187-GCC-8.2.0-2.31.1  impi/2019.2.187
      ifort/2019.2.187-GCC-8.2.0-2.31.1  impi/2019.2.187

Cargar

Este comando carga el modulo NAMD/2.13-mpi:

$ ml NAMD/2.13-mpi
$ ml
 
Currently Loaded Modules:
  1) GCCcore/8.2.0                       4) impi/2019.2.187   7) binutils/2.32  10) FFTW/3.3.8
  2) icc/2019.2.187-GCC-8.2.0-2.31.1     5) imkl/2019.2.187   8) zlib/1.2.11    11) NAMD/2.13-mpi
  3) ifort/2019.2.187-GCC-8.2.0-2.31.1   6) intel/2019b       9) Tcl/8.6.9

Descargar

Descarga un módulo en particular, pero no sus dependencias.

$ ml

 Currently Loaded Modules:
  1) GCCcore/8.2.0                       4) impi/2019.2.187   7) binutils/2.32  10) FFTW/3.3.8
  2) icc/2019.2.187-GCC-8.2.0-2.31.1     5) imkl/2019.2.187   8) zlib/1.2.11    11) NAMD/2.13-mpi
  3) ifort/2019.2.187-GCC-8.2.0-2.31.1   6) intel/2019b       9) Tcl/8.6.9

$ ml unload NAMD/2.13-mpi
$ ml

Currently Loaded Modules:
  1) GCCcore/8.2.0                        4) impi/2019.2.187   7) binutils/2.32  10) FFTW/3.3.8
  2) icc/2019.2.187-GCC-8.2.0-2.31.1      5) imkl/2019.2.187   8) zlib/1.2.11                     
  3) ifort/2019.2.187-GCC-8.2.0-2.31.1    6) intel/2019b       9) Tcl/8.6.9  

Limpiar

Eliminar todos los módulos que previamente se tienen cargados.

$ ml

Currently Loaded Modules:
  1) GCCcore/8.2.0     3) icc/2019.2.187-GCC-8.2.0-2.31.1     5) impi/2019.2.187   7) intel/2019b
  2) binutils/2.31.1   4) ifort/2019.2.187-GCC-8.2.0-2.31.1   6) imkl/2019.2.187

$ ml purge
$ ml
No modules loaded

Ejemplo simple de un script sbatch

Para cargar la versión 3.7 de Python en un script sbatch:

#!/bin/bash
#SBATCH -J example
#SBATCH -p general
#SBATCH -n 1
#SBATCH -o example_%j.out
#SBATCH -e example_%j.err
#SBATCH --mail-user=user@gmail.com
#SBATCH --mail-type=ALL
 
ml Python/3.7.2

[ETC...]