Quantum Espresso

1.  Running the Quantum Espresso suite


Quantum ESPRESSO is an integrated suite of computer codes for electronic-structure calculations and materials modeling at the nanoscale. It is based on density-functional theory, plane waves, and pseudopotentials (both norm-conserving and ultrasoft). For any further information please check the project website.

A recent version of the Quantum Espresso suite is available on Hg1 already compiled and ready for use. The recommended version is compiled with the Intel Fortran Compiler 10.1, uses MKL libraries for linear algebra calculations and the FFTW3 library for Fourier transforms. The suite is compiled with full MPI support, but can be also used for serial runs. You can load it with the command

$ module load espresso

and the module will provide the path to the executables. You don't need to load any other modules in order to use Quantum Espresso as the module espresso will take care to configure the working environment properly. To run PW for example you should include in your PBS scripts a line like the following

mpirun -x PATH -x LD_LIBRARY_PATH pw.x < infile.dat > outfile.dat

and the program should run fine. Please note that by using the module list command you can see what libraries does the module espresso load. In any case the complete path to the suite executables is </opt/espresso/intel/mkl/serial>.

Alternative versions compiled with GNU and PGI compiler suites and using AMD's own ACML libraries are going to be available in the future.

2.  Compiling the Quantum Espresso suite


If you need to compile your own version of the suite this section offers some guidelines to help you build it successfully from source. If you need a version that "just works" don't bother with the following information and stick to the instructions given in the first section.

The Quantum Espresso suite requires the following libraries to work:

  • BLAS and LAPack, usually included in the ACML or MKL package
  • FFTW2, FFTW3 library or ACML/MKL fft routines
  • a working MPI environment

If you don't provide BLAS, LAPack or fft libraries Quantum Espresso will use its own internal implementation, which generally performs much worse than machine optimized libraries (eg. ACML or MKL). Please note that in all the following examples the versions of the libraries might differ from the actual libraries installed. Before compiling check the content of the /opt directory.

2.1  Intel Compiler Suite + MKL + FFTW3

This combination performs well on every architecture, but it's almost mandatory on the zebra queue if you want to achieve good performance.

The bulding process should start by loading the modules that configure the working environment. In this case you should load the following modules:

  • intel
  • openmpi
  • mkl

To provide the libraries' path to Quantum Espresso you can use this small script

#!/bin/sh
export CC=icc
export F77=ifort
export F90=ifort
export MPIF90=mpif90
export CFLAGS=-O2
export FFLAGS=-O2 
export MKL="-L$MKL_LIB -lmkl_intel_lp64 -lmkl_sequential -lmkl_core"
./configure BLAS_LIBS="$MKL" LAPACK_LIBS="$MKL" FFT_LIBS="-L$FFTW_LIB -lfftw3" INCLUDEFFTW="$FFTW_INC"

and run it in the Quantum Espresso main directory.

Unfortunately the configuration script is unable to detect the presence of an external FFTW3 library and will still use its internal implementation. In order to use the external library you should modify manually the make.sys file, found in the Quantum Espresso main directory. The DFLAGS parameter should be set like this

DFLAGS = -D__INTEL -D__FFTW3 -D__MPI -D__PARA

Now you just need to issue the appropriate make command (eg. make all) and the suite should build correctly.

2.2  Intel Compiler Suite + ACML + FFTW3

This combination is suitable for any machine equipped with AMD processors, but might perform worse than the MKL version even on AMD machine. If you plan to work on blade or smp queues you should perform some preliminary benchmarks to verify which libraries peform better on your test case.

The bulding process should start by loading the modules that configure the working environment. In this case you should load the following modules:

  • intel
  • openmpi
  • acml/intel

To provide the libraries' path to Quantum Espresso you can use this small script

#!/bin/sh
export CC=icc
export F77=ifort
export F90=ifort
export MPIF90=mpif90
export CFLAGS=-O2
export F77FLAGS=-O2 
export ACML="-L$ACML_LIB -lacml"
./configure BLAS_LIBS="$ACML" LAPACK_LIBS="$ACML" FFT_LIBS="-L$FFTW_LIB -lfftw3" INCLUDEFFTW="$FFTW_INC"

and run it in the Quantum Espresso main directory.

Unfortunately the configuration script is unable to detect the presence of an external FFTW3 library and will still use its internal implementation. In order to use the external library you should modify manually the make.sys file, found in the Quantum Espresso main directory. The DFLAGS parameter should be set like this

DFLAGS = -D__INTEL -D__FFTW3 -D__MPI -D__PARA

Now you just need to issue the appropriate make command (eg. make all) and the suite should build correctly.