Summary

Sourcehttps://sourceforge.net/projects/elk/

Path:  /software/elk (only on Maxwell)

Documentation

http://www2.mpi-halle.mpg.de/theory_department/research/elk_code_development/

http://elk.sourceforge.net/elk.pdf

License: GPL

Citation: Citation of the code would be appreciated by the contributors. A reference to the Elk website using this BibTeX entry will suffice.

elk is an all-electron full-potential linearised augmented plane-wave (LAPW) code for determining the properties of crystalline solids. It is extensively used for materials which are particularly sensitive to the types of approximation used or for which pseudopotential methods are not appropriate. One aspect which is unique to Elk is that almost all features can be used in combination with each other, resulting in powerful and robust code.

Using  elk

elk environment can be set with the module command: 

module load maxwell 
module avail elk
# --- /software/etc/modulefiles -----
# elk/6.8.4  elk/7.0.12 elk/7.2.42

module load elk
 ELK v7.2.42 compiled with intel/2019, openmpi-intel/3.1.6

elk has been compiled with intel, mkl, and intel-compiled openmpi.  Loading the module will quote which versions exactly. The precise setup used for compilation can be found under /software/elk/<version>/src/make.inc.

Running elk in batch (maxwell)

The elk manual recommends using hybrid mpi/openmp with 1 MPI job per node. A sample job-script could look like this:

#!/bin/bash
#SBATCH --time=0-08:00:00
#SBATCH --partition=maxcpu
#SBATCH --constraint=EPYC
#SBATCH --nodes=4
unset LD_PRELOAD

source /etc/profile.d/modules.sh
module purge
module load maxwell elk

# make sure only to use physical cores
export OMP_NUM_THREADS=$(( $(nproc) / 2 ))

# count nodes, set to 1 if run interactively
nodes=${SLURM_JOB_NUM_NODES:-1} 

# elks recommendation: 1 MPI-job per node (-pernode -np $nodes)
# openmpi 3.1.6 is compiled with cuda support. --mca mpi_cuda_support 0 silences warnings when running on nodes without GPU
mpirun --mca mpi_cuda_support 0 -pernode -np $nodes elk

Building elk

https://sourceforge.net/p/elk/discussion/897820/thread/bb25c53e70/ contains detailed instructions for building elk. The setup used for /software/elk/6.8.4

# see /software/elk/00BUILD
eversion=6.8.4
bdir=/scratch/$USER
idir=/software/elk/$eversion
cd $bdir

# fetch elk from sourceforge: https://sourceforge.net/projects/elk/
wget https://sourceforge.net/projects/elk/files/elk-$eversion.tgz/download -O /software/elk/src/elk-$eversion.tgz

# intel environment
module load maxwell openmpi-intel/3.0.6
source /usr/local/bin/intel-setup-2019.sh intel64 

# building libxc
cd $bdir
wget "http://www.tddft.org/programs/libxc/down.php?file=5.0.0/libxc-5.0.0.tar.gz" -O /software/elk/src/libxc-5.0.0.tar.gz
tar xf /software/elk/src/libxc-5.0.0.tar.gz
cd libxc-5.0.0/
FC=ifort CC=icc ./configure --prefix=$idir
make && make install

# building wannuer90: http://www.wannier.org/download/
# change: MPIF90=mpifort
# change: LIBDIR = /opt/intel/2019/compilers_and_libraries_2019/linux/mkl/lib/intel64
cd $bdir
wget https://github.com/wannier-developers/wannier90/archive/v3.1.0.tar.gz -O /software/elk/src/wannier90-3.1.0.tar.gz
tar xf /software/elk/src/wannier90-3.1.0.tar.gz
cd wannier90-3.1.0/
cp config/make.inc.ifort make.inc
make
make lib
PREFIX=$idir make install

# elk
cd $bdir
tar xf /software/elk/src/elk-$eversion.tgz 
cd elk-$eversion/
cp /software/elk/src/make.inc.intel make.inc
cp $idir/lib/*.a src/
make
# elk doesn't have make install so simply clean up and copy over:
find . -name "*.o" -exec rm {} \;
tar cf - . | ( cd $idir; tar xf - )