Environment Modules
Environment modules allow you to easily load and unload software for use on the cluster.
Basic Commands
module avail
Show all available modules
module add <module>
Adds a module to your environment for this session
module initadd <module>
Configure module to be loaded at every login
module rm <module>
or module unload
Removes a module that is currently loaded
module purge
Removes all modules that are currently loaded
module help
Provides some simple information about a module
Example
By default the GNU gcc compiler and the slurm Workload manager are loaded. If we want to use the intel compiler instead of the gcc compiler we can use the following:
[user.name@hodor ~]$ module list
Currently Loaded Modulefiles:
1) gcc/6.1.0 2) slurm/16.05.8
[user.name@hodor ~]$ module rm gcc
[user.name@hodor ~]$ module list
Currently Loaded Modulefiles:
1) slurm/16.05.8
[user.name@hodor ~]$ module load intel/compiler/64
[user.name@hodor ~]$ module list
Currently Loaded Modulefiles:
1) slurm/16.05.8 2) intel/compiler/64/16.0.4/2016.4.258
When this is done the various environment variables that are required to use the intel compiler will be loaded.
Currently Available Modules On The Cluster
To get the most up-to-date version of this list, login to the cluster and run module avail
.
Below is the list of currently Available modules:
---------------------------- /cm/local/modulefiles -----------------------------
1.49 dot log4perl/1.49
cluster-tools/7.3 freeipmi/1.5.2 module-git
cluster-tools-dell/7.3 gcc/6.1.0 module-info
cmd intel/mic/runtime/3.8.3 null
cm-scale-cluster/7.3 intel/mic/sdk/3.8.3 openldap
cmsh ipmitool/1.8.17 shared
---------------------------- /cm/shared/modulefiles ----------------------------
acml/gcc/64/5.3.1 intel/gdb/64/7.8.0/2016.4.258
acml/gcc/fma4/5.3.1 intel/ipp/32/9.0.4/2016.4.258
acml/gcc/mp/64/5.3.1 intel/ipp/64/9.0.4/2016.4.258
acml/gcc/mp/fma4/5.3.1 intel/mkl/32/11.3.4/2016.4.258
acml/gcc-int64/64/5.3.1 intel/mkl/64/11.3.4/2016.4.258
acml/gcc-int64/fma4/5.3.1 intel/mkl/mic/11.3.4/2016.4.258
acml/gcc-int64/mp/64/5.3.1 intel/mpi/32/16.0.4/2016.4.258
acml/gcc-int64/mp/fma4/5.3.1 intel/mpi/64/5.1.3/2016.4.258
acml/open64/64/5.3.1 intel/mpi/mic/5.1.3/2016.4.258
acml/open64/fma4/5.3.1 intel/tbb/32/4.4.6/2016.4.258
acml/open64/mp/64/5.3.1 intel/tbb/64/4.4.6/2016.4.258
acml/open64/mp/fma4/5.3.1 intel/tbb/mic/4.4.6/2016.4.258
acml/open64-int64/64/5.3.1 intel-cluster-runtime/ia32/3.8
acml/open64-int64/fma4/5.3.1 intel-cluster-runtime/intel64/3.8
acml/open64-int64/mp/64/5.3.1 intel-cluster-runtime/mic/3.8
acml/open64-int64/mp/fma4/5.3.1 intel-tbb-oss/ia32/2017_20170807oss
blacs/openmpi/gcc/64/1.1patch03 intel-tbb-oss/intel64/2017_20170807oss
blacs/openmpi/open64/64/1.1patch03 iozone/3_434
blas/gcc/64/3.6.0 lapack/gcc/64/3.6.0
blas/open64/64/3.6.0 lapack/open64/64/3.6.0
bonnie++/1.97.1 libstdc++-devel/4.8.5-11
cmake/3.9.6 libstdc++-devel.i686/4.8.5-11
cmgui/7.3 libstdc++-static/4.8.5-11
cuda75/blas/7.5.18 libstdc++-static.i686/4.8.5-11
cuda75/fft/7.5.18 log4perl/1.49
cuda75/nsight/7.5.18 mpich/ge/gcc/64/3.2rc2
cuda75/profiler/7.5.18 mpich/ge/open64/64/3.2rc2
cuda75/toolkit/7.5.18 mpiexec/0.84_432
default-environment mvapich2/gcc/64/2.2rc1
fftw2/openmpi/gcc/64/double/2.1.5 mvapich2/open64/64/2.2rc1
fftw2/openmpi/gcc/64/float/2.1.5 netcdf/gcc/64/4.4.0
fftw2/openmpi/open64/64/double/2.1.5 netcdf/intel/64/4.4.0
fftw2/openmpi/open64/64/float/2.1.5 netcdf/open64/64/4.4.0
fftw3/openmpi/gcc/64/3.3.4 netperf/2.7.0
fftw3/openmpi/open64/64/3.3.4 open64/4.5.2.1
gdb/7.11 openblas/dynamic/0.2.18
globalarrays/openmpi/gcc/64/5.4 openlava/3.3.3
globalarrays/openmpi/open64/64/5.4 openmpi/gcc/64/1.10.1
hdf5_18/1.8.17 openmpi/open64/64/1.10.1
hpl/2.2 python/2.6.9
hwloc/1.11.3 scalapack/openmpi/gcc/64/2.0.2
intel/compiler/32/16.0.4/2016.4.258 sge/2011.11p1
intel/compiler/64/16.0.4/2016.4.258 SHARPpy/1.3.0
intel/daal/64/2016.4/2016.4.258 slurm/16.05.8
intel/gdb/32/7.8.0/2016.4.258 torque/6.0.2
---------------------------- /cm/local/modulefiles -----------------------------
cluster-tools/8.1 cuda-dcgm/1.3.3.1 intel/mic/sdk/3.8.4 module-info shared
cm-scale/8.1 dot ipmitool/1.8.18 null
cmd freeipmi/1.5.7 lua/5.3.4 opencv3
cmsh gcc/7.2.0 module-git openldap
---------------------------- /cm/shared/modulefiles ----------------------------
acml/gcc-int64/64/5.3.1 globalarrays/openmpi/gcc/64/5.6.1
acml/gcc-int64/fma4/5.3.1 hdf5/1.10.1
acml/gcc-int64/mp/64/5.3.1 hdf5_18/1.8.20
acml/gcc-int64/mp/fma4/5.3.1 hpcx/2.0.0
acml/gcc/64/5.3.1 hpl/2.2
acml/gcc/fma4/5.3.1 hwloc/1.11.8
acml/gcc/mp/64/5.3.1 intel-tbb-oss/ia32/2018_20180312oss
acml/gcc/mp/fma4/5.3.1 intel-tbb-oss/intel64/2018_20180312oss
bazel/0.11.1 iozone/3_471
blacs/openmpi/gcc/64/1.1patch03 lapack/gcc/64/3.8.0
blas/gcc/64/3.8.0 mpich/ge/gcc/64/3.2.1
bonnie++/1.97.3 mpiexec/0.84_432
cntk/5 mvapich2/gcc/64/2.3b
cuda91/blas/9.1.85 nccl2/2.1.15
cuda91/fft/9.1.85 netcdf/gcc/64/4.5.0
cuda91/nsight/9.1.85 netperf/2.7.0
cuda91/profiler/9.1.85 openblas/dynamic(default)
cuda91/toolkit/9.1.85 openblas/dynamic/0.2.20
cudnn/7.0 openmpi/cuda/64/3.0.0
default-environment openmpi/gcc/64/1.10.7
fftw2/openmpi/gcc/64/double/2.1.5 protobuf/3.2.1
fftw2/openmpi/gcc/64/float/2.1.5 scalapack/openmpi/gcc/64/2.0.2
fftw3/openmpi/gcc/64/3.3.7 sge/2011.11p1
gcc5/5.5.0 slurm/17.11.5
gdb/8.0.1 torque/6.1.1
Making Your Own Modulefiles
If you have programs that you built in a directory on your account you can create a modulefile to simplify the process of loading it.
First create a directory where you will store your module files. In this example we will use a hidden directory .personalModulefiles
mkdir ~/.personalModulefiles
Next we will need to add this directory to the locations where the environment modules are found. To do this we will use: module use /home/first.last/.personalModulefiles
If you want to have this directory added to the list automatically when you login, you can run this command (after entering your username) to have it added to your .bashrc which will load on login.
echo "module use /home/first.last/.personalModulefiles" >> ~/.bashrc
Now that we have added the personalModfiles directory to the modulefiles search path, we can start to add our own modulefiles in this folder. Modulefiles for the UND clusters are written in the tcl language.
This is an example of a modulefile used to load the mpi version of dl_poly. We will save it in a subfolder dl_poly
with the name 4.08-mpi
. This give us the path /home/first.last/.personalModulefiles/dl_poly/4.08-mpi
:
#%Module -*- tcl -*-
##
## dot modulefile
##
## The next two sections provide information about the module when you run the module help commands.
proc ModulesHelp { } {
puts stderr "\tAdds DL_POLY 4.08-mpi to your environment variables,"
}
module-whatis "Adds DL_POLY 4.08-mpi to your environment variables"
## This will load another module when this one is loaded for example the mpich module.
if { [ module-info mode load ] } {
module load mpich/ge/gcc
}
## This part sets some variables.
set dl_poly_version 4.08-mpi
set root /home/first.last/path_to_dl_poly/$dl_poly_version
## Finally the path is appended to with the location that was provided by the variables.
prepend-path PATH $root/bin
Now when you run module avail
you should see the new module listed
______ /home/first.last/.personalModfiles ______
dl_poly/4.08-mpi
______ /cm/local/modulefiles ______
.
.
.
You can load this module just like you would any other module
module load dl_poly/4.08-mpi
If your new module doesn't show up when you run module avail
, make sure you have #%Module -*- tcl -*-
on the first line of your module file.
More Information
For further reading on environment variables and environment modules:
- https://en.wikipedia.org/wiki/Environment_variable
- https://en.wikipedia.org/wiki/Environment_Modules_%28software%29
If you need assistance using module files on any of the UND clusters contact us