Introduction

Different compilers families and versions are provided, and with them many different flavours of a given package and versions may be available. Loading the right one matching the current setup avoiding incompatibilities with other packages becomes a complex task.

The prgenv module addresses this problem. There is a prgenv for each compiler family, so it can guarantee a minimal compatibility between different packages.

$ module avail prgenv

-------------------------------------------------------------------------------------- Global Aliases ---------------------------------------------------------------------------------------
   pa -> prgenv/amd    pe -> prgenv/expert    pg -> prgenv/gnu    pi -> prgenv/intel    pp -> prgenv/pgi

------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/prgenvs --------------------------------------------------------------------------
   prgenv/amd (a)    prgenv/expert (E,e)    prgenv/gnu (D:g)    prgenv/intel (i)    prgenv/pgi

Loading a prgenv

When loading a prgenv, it will automatically load the default compiler version for that family:

$ module load prgenv/gnu
$ module list

Currently Loaded Modules:
  1) gcc/8.3.1   2) prgenv/gnu

You may then load a different version of the compiler if you wish to do so.

You may load a compiler module on its own, but this will not enable the environment corresponding to its family and thus not enabling all the specific flavoured modules for that compiler family and version


Aliases are provided for all prgenvs for convenience, so:

module load prgenv/gnu

is equivalent to:

module load pg

Changing the prgenv

When loading a different prgenv, all the modules that would be affected by this change will be reloaded appropriately:

$ module load prgenv/gnu
$ module load fftw
$ echo $FFTW_DIR
/usr/local/apps/fftw/3.3.8/GNU/8.4
$ module load prgenv/intel

Due to MODULEPATH changes, the following have been reloaded:
  1) fftw/3.3.8

The following have been reloaded with a version change:
  1) prgenv/gnu => prgenv/intel

$ module list

Currently Loaded Modules:
  1) intel-mkl/19.0.5   2) intel/19.0.5   3) prgenv/intel   4) fftw/3.3.8

$ echo $FFTW_DIR
/usr/local/apps/fftw/3.3.8/INTEL/19.0

Multiple compilers in the same prgenv

It is possible to have more than one compiler loaded in parallel, but all the tools and libraries will be loaded based on the active prgenv.

$ module load prgenv/gnu
$ module load intel
$ module load fftw
$ module list

Currently Loaded Modules:
  1) gcc/8.4.0   2) prgenv/gnu   3) intel-mkl/19.0.5   4) intel/19.0.5   5) fftw/3.3.8

$ gcc --version
gcc (ECMWF) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ icc --version
icc (ICC) 19.0.5.281 20190815
Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

$ echo $FFTW_DIR
/usr/local/apps/fftw/3.3.8/GNU/8.4

The expert prgenv (experimental)

This prgenv is experimental. It may be changed or deleted in the future: use at your own risk

An additional prgenv is provided for those who would like to be a bit more flexible when picking specific flavours of certain libraries, not being forced to the compiler and version defined by the standard prgenvs. To address this, we created the prgenv/expert, where you are completely free to cherry pick whatever flavours of every library and compiler without any constraints. 

The modules on this prgenv will have a suffix after the version number indicating the flavour:

module/version:compiler_family:compiler_version[:mpi_family:mpi_version]

Because of the combinatorial nature of the different options, you will see a very long list of modules available for this specific prgenv

$ module load prgenv/expert
$ module avail expert

-------------------------------------------------------------------------------------- Global Aliases ---------------------------------------------------------------------------------------
   pa -> prgenv/amd    pe -> prgenv/expert    pg -> prgenv/gnu    pi -> prgenv/intel    pp -> prgenv/pgi

------------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/prgenvs --------------------------------------------------------------------------
   prgenv/expert (E,L,e)

--------------------------------------------------------------------- /usr/local/apps/modulefiles/lmod/flavours/expert ----------------------------------------------------------------------
   boost/1.61.0:gnu:4.8.5                           hpcx-openmpi/2.6.0:gnu:8.4                         netcdf4-parallel/4.6.2:intel:19.0:ompi:3.1 (D)
   boost/1.61.0:gnu:8.4                             hpcx-openmpi/2.6.0:gnu:9.3                         netcdf4/4.6.2:gnu:4.8
   boost/1.61.0:gnu:9.3                             hpcx-openmpi/2.6.0:intel:19.0               (D)    netcdf4/4.6.2:gnu:8.4
   boost/1.61.0:intel:19.0                   (D)    intel-mpi/18.0.4:gnu:4.8                           netcdf4/4.6.2:gnu:9.3
   fftw/3.3.8:gnu:4.8                               intel-mpi/18.0.4:gnu:8.4                           netcdf4/4.6.2:intel:19.0                   (D)
   fftw/3.3.8:gnu:8.4                               intel-mpi/18.0.4:gnu:9.3                           openblas/0.3.9:gnu:4.8
   fftw/3.3.8:gnu:9.3                               intel-mpi/18.0.4:intel:18.0                        openblas/0.3.9:gnu:8.4
   fftw/3.3.8:intel:19.0                     (D)    intel-mpi/18.0.4:intel:19.0                        openblas/0.3.9:gnu:9.3
   hdf5-parallel/1.10.4:gnu:4.8:impi:19.0           intel-mpi/19.0.5:gnu:4.8                           openblas/0.3.9:intel:19.0                  (D)
   hdf5-parallel/1.10.4:gnu:4.8:ompi:3.1            intel-mpi/19.0.5:gnu:8.4                           openmpi/3.1.4.3:gnu:8.4
   hdf5-parallel/1.10.4:gnu:8.4:hpcx:2.6            intel-mpi/19.0.5:gnu:9.3                           openmpi/3.1.4.3:gnu:9.3
   hdf5-parallel/1.10.4:gnu:8.4:impi:19.0           intel-mpi/19.0.5:intel:18.0                        openmpi/3.1.4.3:intel:19.0                 (D)
   hdf5-parallel/1.10.4:gnu:8.4:ompi:3.1            intel-mpi/19.0.5:intel:19.0                 (D)    parmetis/4.0.3:gnu:4.8:impi:19.0
   hdf5-parallel/1.10.4:gnu:9.3:hpcx:2.6            netcdf4-parallel/4.6.2:gnu:4.8:impi:19.0           parmetis/4.0.3:gnu:4.8:ompi:3.1
   hdf5-parallel/1.10.4:gnu:9.3:impi:19.0           netcdf4-parallel/4.6.2:gnu:4.8:ompi:3.1            parmetis/4.0.3:gnu:8.4:hpcx:2.6
   hdf5-parallel/1.10.4:gnu:9.3:ompi:3.1            netcdf4-parallel/4.6.2:gnu:8.4:hpcx:2.6            parmetis/4.0.3:gnu:8.4:impi:19.0
   hdf5-parallel/1.10.4:intel:19.0:impi:19.0        netcdf4-parallel/4.6.2:gnu:8.4:impi:19.0           parmetis/4.0.3:gnu:8.4:ompi:3.1
   hdf5-parallel/1.10.4:intel:19.0:ompi:3.1  (D)    netcdf4-parallel/4.6.2:gnu:8.4:ompi:3.1            parmetis/4.0.3:gnu:9.3:hpcx:2.6
   hdf5/1.10.4:gnu:4.8                              netcdf4-parallel/4.6.2:gnu:9.3:hpcx:2.6            parmetis/4.0.3:gnu:9.3:impi:19.0
   hdf5/1.10.4:gnu:8.4                              netcdf4-parallel/4.6.2:gnu:9.3:impi:19.0           parmetis/4.0.3:gnu:9.3:ompi:3.1
   hdf5/1.10.4:gnu:9.3                              netcdf4-parallel/4.6.2:gnu:9.3:ompi:3.1            parmetis/4.0.3:intel:19.0:impi:19.0
   hdf5/1.10.4:intel:19.0                    (D)    netcdf4-parallel/4.6.2:intel:19.0:impi:19.0        parmetis/4.0.3:intel:19.0:ompi:3.1         (D)

Example:

A user wants to use both gcc and intel at the same time, having openblas built for gnu but fftw built for intel:

$ module load prgenv/expert
$ module load gcc/8.4 intel/19 fftw/3.3.8:intel:19.0  openblas/0.3.9:gnu:8.4
$ module list

Currently Loaded Modules:
  1) prgenv/expert (E)   2) gcc/8.4.0   3) intel-mkl/19.0.5   4) intel/19.0.5   5) fftw/3.3.8:intel:19.0   6) openblas/0.3.9:gnu:8.4

  Where:
   E:  Experimental

$ echo $OPENBLAS_DIR
/usr/local/apps/openblas/0.3.9/GNU/8.4
$ echo $FFTW_DIR
/usr/local/apps/fftw/3.3.8/INTEL/19.0