5 Modules usage
5.1 Initialization
The access to the Modules software itself is automatically initialized for you when you log in or when you submit a batch job according to the shell that you use. Nevertheless, you must initialize the DEISA environment yourself at the beginning of your interactive sessions and your submitted jobs by using the deisa modulefile.
For this action, the command is (the output is the one for IBM systems):
> module load deisa
As no personal initialization file "/deisa/home/xxxxxx/yyyyyy/.modules/DMEInit"
is defined, a default one is used, which load the IBM C, C++ and Fortran compilers, \
used through the compiler wrappers.
load IBM C compiler version 10.0 (PATH, LD_LIBRARY_PATH, NLSPATH, MANPATH)
load IBM C++ compiler version 10.0 (PATH, LD_LIBRARY_PATH, NLSPATH, MANPATH)
load IBM Fortran compiler version 12.1 (PATH, LD_LIBRARY_PATH, NLSPATH, MANPATH)
load usage of the compiler wrappers (default)
load 64-bit mode (OBJECT_MODE, DEISA_FFLAGS, DEISA_CFLAGS, DEISA_CXXFLAGS) (default)
which defines the special DEISA variables to reference the file systems in a portable way ($DEISA_HOME, etc. – see section 4.1 of the Primer) and loads all the default modulefiles.
On Cray systems, the output looks like this:
> module load deisa
As no personal initialization file "/deisa/home/xxxxxx/yyyyyy/.modules/DMEInit"
is defined, a default one is used, which load the Cray C, C++ and Fortran compilers, \
used through the compiler wrappers.
load Portland C++ compiler version 7. Please use 'CC' as compiler.
load Portland C compiler version 7. Please use 'cc' as compiler.
load Portland Fortran compiler version 7. Please use 'ftn' or 'f77' for compilation.
load usage of the compiler wrappers (default)
On Altix SGI systems, the output looks like this:
> module load deisa
As no personal initialization file "/deisa/home/xxxxxx/yyyyyy/.modules/DMEInit"
is defined, a default one is used, which load the Intel C, C++ and Fortran compilers, \
used through the compiler wrappers.
load Intel C++ compiler version 10.1 (PATH, LIBPATH, MANPATH)
load Intel C compiler version 10.1 (PATH, LIBPATH, MANPATH)
load Intel Fortran compiler version 10.1 (PATH, LIBPATH, MANPATH)
load usage of the compiler wrappers (default)
For each subgroup of systems, these default modulefiles are:
IBM systems (except the BlueGene systems): c, c++, fortran, compilerwrappers/yes, mode64, deisa IBM BlueGene, Cray XT4 and HPC Linux SGI systems: c, c++, fortran, compilerwrappers/yes, deisa
5.2 Help
The help subcommand gives you the syntax of the main subcommands of module:
> module help
Available Commands and Usage:
+ list
+ avail
+ help modulefile [modulefile ...]
+ whatis modulefile
+ display modulefile
+ load modulefile [modulefile ...]
+ unload modulefile [modulefile ...]
+ switch modulefile1 modulefile2
. . .
5.3 List of the modulefiles currently loaded
The list subcommand lists all the modulefiles, which are currently loaded in your environment. For instance, after the initialization step done by the deisa modulefile you must have on IBM systems:
> module list Currently Loaded Modulefiles: 1) c/ibm/10.0 3) fortran/ibm/12.1 5) mode/64 2) c++/ibm/10.0 4) compilerwrappers/yes 6) deisa
On the Cray XT4 systems:
> module list Currently Loaded Modulefiles: 1) c/portland/7 3) fortran/portland/7 5) mode/64 2) c++/portland/7 4) compilerwrappers/yes 6) deisa
And on Altix SGI systems:
> module list Currently Loaded Modulefiles: 1) c/intel/10.1 3) fortran/intel/10.1 5) deisa 2) c++/intel/10.1 4) compilerwrappers/yes
5.4 List of the available modulefiles
The avail subcommand gives the complete list of all the modulefiles available on the system on which it is executed − that is all the components of the DEISA Common Production Environment, including all versions. As previously said, the modulefiles without any version number are the default versions. Due to these various versions for each component, this list is rather long, as you may see in the examples below (of course, the list that you will get depends on the moment on which you execute this command, as the software versions evolve). For the AIX IBM systems:
------------ /usr/local/pub/Modules/modulefiles/init ------------ deisa ------------ /usr/local/pub/Modules/modulefiles/environment ------------ compilerwrappers/no mode/32 compilerwrappers/yes(default) mode/64(default) ------------ /usr/local/pub/Modules/modulefiles/compilers ------------ c++/ibm/9.0 c/ibm/10.0 java/ibm/1.4(default) c++/ibm/10.0(default) fortran/ibm/11.1 java/ibm/1.5 c/ibm/9.0 fortran/ibm/12.1(default) ------------ /usr/local/pub/Modules/modulefiles/libraries ------------ blacs/3(default) fftw/3 pessl/3(default) blacssmp/3(default) hdf5/1.6(default) pesslsmp/3(default) blas/4(default) lapack/3.0(default) pwsmp/7 blassmp/4(default) mass/4(default) pwsmp/8(default) essl/4(default) nag/20 scalapack/1.8(default) esslsmp/4(default) nag/21(default) wsmp/7 fftw/2.1.5(default) netcdf/3(default) wsmp/8(default) ------------ /usr/local/pub/Modules/modulefiles/tools ------------ emacs/21(default) omniorb/4.0(default) tcl/8.5(default) globus/4.0(default) openssh/3(default) tk/8.5(default) gmake/3(default) perl/5.8(default) totalview/8(default) hpm/3.2(default) python/2.4(default) nedit/5(default) python/2.5 ------------ /usr/local/pub/Modules/modulefiles/applications ------------ cpmd/3.13(default) cpmd2cube/2008.07 lammps/2008.01.22 cpmd/3.11 gopenmol/3.00(default) namd/2.6(default)
For the Linux/PowerPC IBM system:
> module avail ------------ /usr/share/modules/modulefiles ------------ deisa ------------ /usr/share/modules/deisa/modulefiles/environment ------------ compilerwrappers/no mode/32 compilerwrappers/yes(default) mode/64(default) ------------ /usr/share/modules/deisa/modulefiles/compilers ------------ c/ibm/8.0(default) fortran/ibm/10.1(default) c++/ibm/8.0(default) java/ibm/1.4(default) ------------ /usr/share/modules/deisa/modulefiles/libraries ------------ blacs/3(default) fftw/2.1.5(default) netcdf/3(default) blacssmp/3(default) fftw/3 pessl/3(default) blas/4(default) hdf5/1.4.4 pesslsmp/3(default) blassmp/4(default) hdf5/1.6(default) scalapack/1.7(default) essl/4(default) lapack/3.0(default) esslsmp/4(default) mass/4(default) ------------ /usr/share/modules/deisa/modulefiles/tools ------------ emacs/21(default) omniorb/4.1(default) tcl/8.4(default) globus/4.0(default) openssh/3(default) tk/8.4(default) gmake/3(default) perl/5.8(default) nedit/5(default) python/2.4(default) ------------ /usr/share/modules/deisa/modulefiles/applications ----------- cpmd/3.11(default) cpmd2cube/2008.07(default) gopenmol/2.32(default)
For the Linux/BlueGene IBM systems:
> module avail ------------ /usr/share/modules/modulefiles ------------ deisa ------------ /usr/share/modules/deisa/modulefiles/environment ------------ compilerwrappers/no compilerwrappers/yes(default) ------------ /usr/share/modules/deisa/modulefiles/compilers ------------ c++/ibm/9.0(default) fortran/ibm/11.1(default) c/ibm/9.0(default) java/ibm/1.5(default) ------------ /usr/share/modules/deisa/modulefiles/libraries ------------ blacs/3(default) esslsmp/4(default) lapack/3.1(default) blas/4(default) fftw/2.1.5(default) mass/4(default) blassmp/4(default) fftw/3 netcdf/3(default) essl/4(default) hdf5/1.8(default) scalapack/1.7(default) ------------ /usr/share/modules/deisa/modulefiles/tools ------------ emacs/21(default) python/2.4(default) totalview/8(default) gmake/3(default) tcl/8.5(default) perl/5.8(default) tk/8.5(default) ------------ /usr/share/modules/deisa/modulefiles/applications ----------- cpmd/3.13(default) namd/2.6(default) lammps/2008.01.22(default)
For the Cray XT4 system:
> module avail ------------ /opt/deisa/modules/modulefiles/init ------------ deisa ------------ /opt/deisa/modules/modulefiles/environment ------------ compilerwrappers/no compilerwrappers/yes(default) ------------ /opt/deisa/modules/modulefiles/compilers ------------ c/portland/7(default) fortran/portland/7(default) c++/portland/7(default) java/1.4(default) ------------ /opt/deisa/modules/modulefiles/libraries ------------ acml/3.6.1(default) fftw/3 netcdf/3(default) blacs/3(default) hdf5/1.6(default) scalapack/1.7(default) blas/4(default) lapack/3.0(default) fftw/2.1.5(default) libsci/10.0.1(default) ------------ /opt/deisa/modules/modulefiles/tools ------------ craypat/3.2.3(default) nedit/5(default) tcl/8.4(default) deshl/4.0(default) omniorb/4.1(default) tk/8.4(default) emacs/21(default) openssh/4(default) totalview/7(default) globus/4.0(default) perl/5.8(default) gmake/3(default) python/2.4(default) ------------ /opt/deisa/modules/modulefiles/applications ------------ cpmd/3.13(default) lammps/2007.06.12(default) cpmd2cube/2008.07(default) namd/2.6(default) gopenmol/3.00(default) wien2k/05(default)
And for the Altix SGI systems:
> module avail ------------ /opt/deisa/DEISA-Modules/modulefiles/init ------------ deisa ------------ /opt/deisa/DEISA-Modules/modulefiles/environment ------------ compilerwrappers/no compilerwrappers/yes(default) ------------ /opt/deisa/DEISA-Modules/modulefiles/compilers ------------ c/intel/10.1(default) fortran/intel/10.1(default) c++/intel/10.1(default) java/1.4(default) ------------ /opt/deisa/DEISA-Modules/modulefiles/libraries ------------ blas/4(default) lapack/3.0(default) scalapack/1.7(default) blassmp/4(default) lapacksmp/3.0(default) scalapacksmp/1.7(default) fftw/2.1.5(default) mkl/8.0 scsl/1.5(default) fftw/3.0.1 mkl/9.1(default) scslsmp/1.5(default) hdf5/1.6.3 nag/21(default) hdf5/1.6.4(default) netcdf/3(default) ------------ /opt/deisa/DEISA-Modules/modulefiles/tools ------------ emacs/21(default) histx/1.2a(default) python/2.4(default) globus/4.0(default) nedit/5.5(default) tcl/8.4(default) gmake/3(default) perl/5.8(default) tk/8.4(default) ------------ /opt/deisa/DEISA-Modules/modulefiles/applications ----------- cpmd/3.13(default) namd/2.6b1(default)
5.5 Help on a specific modulefile
The help subcommand, followed by the name of a modulefile, gives more information about its purpose and effect, as shown in this example for the Fortran IBM compiler on AIX systems:
> module help fortran -------------------------------------------------------------------------- Module Specific Help for /usr/local/pub/Modules/modulefiles/compilers/fortran/12.1: IBM Fortran compiler version 12.1 (PATH, LIBPATH, NLSPATH, MANPATH) **** DEISA Common Production Environment **** modulefile "fortran/12.1" – Version 1.2 Set environment variables to use the IBM Fortran compiler version 12.1. --------------------------------------------------------------------------
5.6 Location of a modulefile and its brief description
The whatis subcommand gives the location of a modulefile and its brief description:
> module whatis fftw
----------- /usr/local/pub/Modules/modulefiles/init -------------
----------- /usr/local/pub/Modules/modulefiles/environment -------------
----------- /usr/local/pub/Modules/modulefiles/compilers -------------
----------- /usr/local/pub/Modules/modulefiles/libraries -------------
fftw/2.1.5: Set environment variables to enable the usage of the FFTW 2.1.5 numerical library.
----------- /usr/local/pub/Modules/modulefiles/tools -------------
----------- /usr/local/pub/Modules/modulefiles/applications -------------
5.7 Detailed description of a modulefile
The display subcommand describes what would be the effect of the specified modulefile in your environment, showing which changes it would make in the content of the environment variables PATH, MANPATH, etc. and which new variables it would define. Below, an example for the fortran modulefile on one AIX IBM system (note that in all the following examples the results of the commands may vary from one machine to another (paths displayed, etc.), but the goal of these examples is to demonstrate the behaviour of the environment):
> module display fortran -------------------------------------------------------------------------- /usr/local/pub/Modules/modulefiles/compilers/fortran/12.1: module-whatis Set environment variables to use the IBM Fortran compiler version 12.1. prepend-path PATH /usr/local/prod/xlf12102/usr/bin conflict fortran display IBM Fortran compiler version 12.1 (PATH, LIBPATH, NLSPATH,MANPATH) --------------------------------------------------------------------------
5.8 Loading a modulefile
The load subcommand adds a modulefile in your environment, executing all the commands defined inside. As previously stated, appending a version number to the name of the component will load the modulefile of this specific version, which can be different from the default one.
> module list Currently Loaded Modulefiles: 1) c/ibm/10.0 3) fortran/ibm/12.1 5) mode/64 2) c++/ibm/10.0 4) compilerwrappers/yes 6) deisa > echo $DEISA_LDFLAGS > > module load lapack load ESSL Library 4 in 32/64-bit mode (DEISA_LDFLAGS) load BLAS Library 4 (DEISA_LDFLAGS) load LAPACK Library 3.0 in 32/64-bit mode (DEISA_LDFLAGS) > module list Currently Loaded Modulefiles: 1) c/ibm/10.0 4) compilerwrappers/yes 7) essl/4 2) c++/ibm/10.0 5) mode/64 8) blas/4 3) fortran/ibm/12.1 6) deisa 9) lapack/3.0 > echo $DEISA_LDFLAGS -L/usr/local/pub/lib –llapack –lessl > echo $CPMD > > module load cpmd load cpmd/3.13 (PATH, CPMD_EXEDIR, CPMD, CPMD_PPLIBRARY) > module list Currently Loaded Modulefiles: 1) c/ibm/10.0 5) mode/64 9) lapack/3.0 2) c++/ibm/10.0 6) deisa 10) cpmd/3.13 3) fortran/ibm/12.1 7) essl/4 4) compilerwrappers/yes 8) blas/4 > echo $CPMD /usr/local/prod/cpmd/cpmd-3.13.1/cpmd_MPI
5.9 Unloading a modulefile
The unload subcommand allows you to remove all the definitions set up by a previous load command. The modulefiles can be removed in any order.
> module list Currently Loaded Modulefiles: 1) c/ibm/10.0 5) mode/64 9) lapack/3.0 2) c++/ibm/10.0 6) deisa 10) cpmd/3.13 3) fortran/ibm/12.1 7) essl/4 4) compilerwrappers/yes 8) blas/4 > module unload lapack unload LAPACK Library 3.0 in 32/64-bit mode(DEISA_LDFLAGS) > module list Currently Loaded Modulefiles: 1) c/ibm/10.0 5) mode/64 9) cpmd/3.13 2) c++/ibm/10.0 6) deisa 3) fortran/ibm/12.1 7) essl/4 4) compilerwrappers/yes 8) blas/4 > echo $DEISA_LDFLAGS -lessl
5.10 Switching between two versions of a modulefile
It is easy to switch between two different versions of a software. This subcommand shows the power of the Modules concept, as different versions of huge and complex packages, like compilers or complete applications, can be replaced using a single simple command, and this can be done independently of the shell that is used. (Take care in the following examples as the versions of the packages used are for illustration purposes only and may be currently unavailable).
> module switch fortran fortran/11.1 ... unload IBM Fortran compiler version 12.1 (PATH, LIBPATH, NLSPATH, MANPATH) ... load IBM Fortran compiler version 11.1 (PATH, LIBPATH, NLSPATH, MANPATH) > echo $PATH /usr/local/pub/Modules/wrappers/fortran/:/usr/local/xlf111005/usr/bin:...
> module load cpmd load cpmd/3.13 (PATH, CPMD_EXEDIR, CPMD, CPMD_PPLIBRARY) > echo $CPMD /usr/local/prod/CPMD/CPMD-3.13.1/cpmd_MPI > module switch cpmd cpmd/3.11 unload cpmd/3.13 (PATH, CPMD_EXEDIR, CPMD, CPMD_PPLIBRARY) load cpmd/3.11 (PATH, CPMD_EXEDIR, CPMD, CPMD_PPLIBRARY) > echo $CPMD /usr/local/prod/CPMD/CPMD-3.11.1/cpmd_MPI


