Quantum ESPRESSO* for the Intel® Xeon Phi™ Processor


Quantum ESPRESSO* ("QE") is is an integrated suite of open-source computer codes for electronic-structure calculations and materials modeling at the Nanoscale. It is based on density-functional theory (DFT), Plane Waves, and Pseudopotentials.

This recipe describes how to get, build, and run Quantum ESPRESSO* on the Intel® Xeon Phi™ x200 processor family (previously code-named "Knights Landing" or "KNL"). However, this articles seamlessly applies to any Intel Xeon processor, and also summarizes some best known methods for using Intel Software Development Tools with Quantum Espresso (QE) on Intel based systems.

To simplify the configuration and build process, this article provides a collection of configure-wrapper scripts, which can be used to call the original configure script. In addition to this article, one may check the XCONFIGURE project directly.

Eigenvalue SoLvers for Petaflop-Applications (ELPA)

Quantum Espresso optionally uses the ELPA library, which has proven to be beneficial (in terms of performance) when compared to ScaLAPACK's Eigenvalue solver routines. ELPA does not replace ScaLAPACK as a whole, but supplies an alternative Eigenvalue solver. ELPA's build system is based on GNU* Autotools and can be configured for Intel Compiler, Intel MKL, and Intel MPI.

  1. Clone or download the ELPA configure wrapper scripts (see XCONFIGURE reference).
  2. Download an ELPA release from http://elpa.mpcdf.mpg.de/elpa-tar-archive and unarchive.
        $ wget http://elpa.mpcdf.mpg.de/html/Releases/2016.11.001.pre/elpa-2016.11.001.pre.tar.gz
        $ tar xvf elpa-2016.11.001.pre.tar.gz
        $ cd elpa-2016.11.001.pre
        Alternatively, git-clone the KNL-branch of the ELPA repository (Intel AVX-512):
        $ git clone --branch ELPA_KNL https://gitlab.mpcdf.mpg.de/elpa/elpa.git
  3. Copy the configure wrapper scripts into ELPA's root folder (where the actual "configure" is).
        $ cp /path/to/configure-elpa* .
        Alternatively, download the scripts by using configure-get.sh:
        $ wget https://github.com/hfp/xconfigure/raw/master/configure-get.sh
        $ chmod +x configure-get.sh
        $ ./configure-get.sh elpa
  4. Make the Intel Compiler available on your command line, for example:
        $ source /opt/intel/compilers_and_libraries_2017.2.174/linux/bin/compilervars.sh intel64
        $ source /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/bin/mklvars.sh intel64
        Note: it is possible to overlay specific versions of Intel development tools.
  5. Run the wrapper for the desired configuration, build and install (necessary!) the library:
        $ ./configure-elpa-knl-omp.sh
        $ make -j ; make install

The configure wrapper scripts (mentioned above) produce a directory layout which is already suitable for building Quantum Espresso (shown below).

Building Quantum Espresso

The configure wrapper scripts mentioned above (ELPA) and below require Quantum Espresso version 6.0 and above (QE 6.x).

  1. Clone or download the Quantum Espresso configure wrapper scripts (see XCONFIGURE reference).
  2. Download QE from http://www.qe-forge.org/gf/project/q-e/frs/ and unarchive.
        $ wget http://www.qe-forge.org/gf/download/frsrelease/240/1075/qe-6.1.tar.gz
        $ tar xvf qe-6.1.tar.gz
        $ cd qe-6.1
  3. Copy the configure wrapper scripts into QE's root folder (location of the original "configure" script).
        $ cp /path/to/configure-qe* .
        Alternatively, download the scripts by using configure-get.sh:
        $ wget https://github.com/hfp/xconfigure/raw/master/configure-get.sh
        $ chmod +x configure-get.sh
        $ ./configure-get.sh qe
  4. Make the Intel Compiler available on your command line (if not already source'd).
        $ source /opt/intel/compilers_and_libraries_2017.2.174/linux/bin/compilervars.sh intel64
        $ source /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/bin/mklvars.sh intel64
  5. Run the wrapper for the desired configuration (ELPA configuration should match):
        $ ./configure-qe-knl-omp.sh
  6. Build the desired Quantum Espresso applications (e.g., "pw", "cp", or "all").
        $ make pw -j

References and Related Articles

For more complete information about compiler optimizations, see our Optimization Notice.


Minh C.'s picture

Thank you so much Hans P. (Intel),

I have run QE on Xeon Phi with LIBXPHI. I compile the program with XCONFIGURE you mentioned (no TARGET) and use LIBXPHI to offload QE on Xeon Phi.

Thank you so much for your attention.

Hans P. (Intel)'s picture

Dear Minh C.,

( I overlooked your response on this page - sorry for my late reply! )

Unfortunately, this article only focuses on Xeon Phi coprocessor (and not the "Knights Corner" coprocessor). When you are using the configure-qe-knl-omp.sh script, you will bake-in a requirement for KNL (a.k.a. "Knights Landing").

Commenting out TARGET will do you no favour on KNC; at least you need "-mmic". However, due to usually high memory requirements for almost all QE workloads, you will be unhappy with a coprocessor-hosted application (a.k.a. "native"). Your best choice is to offload hotspots such as ZGEMM by relying on an older/different article, which focused on KNC (libxphi); see below.

By commenting out "TARGET", you will build QE for a generic host and then *nothing* is offloaded (but everything runs on the host). You need either LIBXPHI, or MKL's auto-offload. I recommend you to choose configure-qe-XXX-omp.sh with an XXX that matches your host (perhaps "snb" a.k.a. "SandyBridge"), **and** to have a look at MKL's auto-offload feature. It should be totally feasible to offload arithmetically intense routines such as ZGEMM, which appear to be a regular hotspot in QE (diagonalization phase).

Minh C.'s picture

And, another comment. This guide seems to be I cannot run QE on Xeon Phi Knight Corner. Because I use the configure file - configure-qe-knl-omp.sh, it is compiled successfully. But when I run it, the warning: "lease verify that both the operating system and the processor support Intel(R) AVX512F, ADX, RDSEED, AVX512ER, AVX512PF and AVX512CD instructions."

And I saw the #TARGET="-xMIC-AVX512" in this configure file. So, I comment this line and compile again. It can be compiled successful, but it seems to be not running QE on Xeon Phi as I told you above.

Please help me! Thank you so much!

Minh C.'s picture

Dear Hans,

Do you have a detailed tutorial for running QE on Intel Xeon Phi? Because, I have followed how to compile QE with Xeon Phi on this page

but when I run it (followed by https://software.intel.com/en-us/articles/quantum-espresso-for-intel-xeon-phi-coprocessor or https://software.intel.com/en-us/articles/explicit-offload-for-quantum-espresso). It seems to be not running on Xeon Phi. It just occupied all of CPU cores on host. I have checked with $ top command on Xeon Phi, it was not running on Xeon Phi by offload mode.

Therefore, I want to ask you for a detailed tutorial about running QE on Xeon Phi. I want to benchmark the performance of CPU-XeonPhi cluster. Thank you so much!

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.