Running Quantum Espresso on Grex

Introduction#


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).

System specific notes#


On the Grex’s default software stack (SBEnv), Espresso is built using a variety of compilers and Open MPI 4.1

To find out which versions are available, use module spider espresso.

For a version 7.3.1, at the time of writing the following modules should be loaded:

module load arch/avx512  intel/2023.2  openmpi/4.1.6
module load espresso/7.3.1

The above module gives access to the Espresso built with traditional Intel compilers and MKL. These would be recommended for compute nodes using Intel AVX512 CPUs.

For better efficiency on AMD CPUs (partitions genoa, genlm) a better performance may be achieved by using GCC compilers and AOCL linear algebra packages: Note that the module version has +aocl-4.2.0 ; this notation shows that it had been built with AOCL.

module load arch/avx512  gcc/13.2.0  openmpi/4.1.6
module load espresso/7.3.1+aocl-4.2.0
Script example for running Quantum Espresso on Grex
run-espresso.sh
#!/bin/bash

#SBATCH --ntasks=32  --mem-per-cpu=4000mb
#SBATCH --time=0-3:00:00
#SBATCH --job-name=ausurf

# Adjust the number of tasks, time and memory required.
# the above spec is for 32 MPI compute tasks 

# Load the modules for the Intel version

module load SBEnv

module load arch/avx512 intel/2023.2 openmpi/4.1.6 
module load espresso/7.3.1

## for AMD partitions --partition=genoa uncomment the modules below:

#module load  arch/avx512  gcc/13.2.0  openmpi/4.1.6
#module load  espresso/7.3.1+aocl-4.2.0

# Unless multithreading is required, it is better to use serial BLAS/LAPACK

export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export BLIS_NUM_THREADS=1

which pw.x

# lets run the AuSurf example, assuming inputs in the current directory
# adjust pw.x options such as -npool and -ndiag according to your system and number of tasks!

echo "Starting run at: `date`"

srun pw.x -input ausurf.in -npool 2 -ndiag 16 > ausurf.${SLURM.}.log

echo "Program finished with exit code $? at: `date`"

Assuming the script above is saved as run-espresso.sh, it can be submitted with:

sbatch run-espresso.sh

For more information, visit the page running jobs on Grex

Running GPU version of Espresso#

It is possible to build a version of Quantum Espresso using GPU hardware. Doing so requires the NVidia HPC compilers toolkit which is available on the NGC Cloud. However, an easier way would be to just pull a latest Espresso version from the same NGC cloud using either Singularity or Podman .

https://catalog.ngc.nvidia.com/orgs/hpc/containers/quantum_espresso