From 5c74c929dfad2929441657c4506f5513cf37ad16 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 25 Jul 2024 12:55:45 +0200 Subject: [PATCH 1/7] Added demo files for QuantumESPRESSO --- QuantumESPRESSO/READEME.md | 8 ++ QuantumESPRESSO/run.sh | 204 +++++++++++++++++++++++++++++++++++++ 2 files changed, 212 insertions(+) create mode 100644 QuantumESPRESSO/READEME.md create mode 100755 QuantumESPRESSO/run.sh diff --git a/QuantumESPRESSO/READEME.md b/QuantumESPRESSO/READEME.md new file mode 100644 index 0000000..b4b0aac --- /dev/null +++ b/QuantumESPRESSO/READEME.md @@ -0,0 +1,8 @@ +QuantumESPRESSO example + +This is an exemplified calculation of the band structure of silicon using QuantumESPRESSO. +The calculation is performed in two steps: first, a self-consistent field calculation is performed to obtain the charge density, and then a non-self-consistent calculation is performed to obtain the band structure. The assumption is made that the proper convergence tests have already been performed and the lattice parameter has been optimized. + +Example readapted form https://github.com/Crivella/DFT_QE_beginner_tutorial/tree/master/0_Si_bulk/4_bandstructure + +Runtime: ~5seconds on a single core diff --git a/QuantumESPRESSO/run.sh b/QuantumESPRESSO/run.sh new file mode 100755 index 0000000..bfa5e6f --- /dev/null +++ b/QuantumESPRESSO/run.sh @@ -0,0 +1,204 @@ +if [[ $EESSI_CVMFS_REPO == "/cvmfs/software.eessi.io" ]] && [[ $EESSI_VERSION == "2023.06" ]]; then + echo "Running demo for QuantumESPRESSO 7.3.1 ..." + module load QuantumESPRESSO/7.3.1-foss-2023a + module load gnuplot/5.4.8-GCCcore-12.3.0 +else + echo "Don't know which QuantumESPRESSO module to load for ${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}" >&2 + exit 1 +fi + +if [ ! -f Si.pz-vbc.UPF ]; then + curl -OL http://pseudopotentials.quantum-espresso.org/upf_files/Si.pz-vbc.UPF +fi + +PSEUDO_DIR=$(pwd) +TMP_DIR=$(pwd)/tmp +RUN_COMMAND="" + +echo "Parallel command:" $RUN_COMMAND +echo "Started at: " `date` + +############################################################3 +# Calculate the SCF charge density + +IN=si_script.scf.in +OUT=si.scf.out +cat > $IN << EOF +&CONTROL + calculation = "scf", + prefix = "Si", + pseudo_dir = "$PSEUDO_DIR", + outdir = "$TMP_DIR", + restart_mode = "from_scratch" + tprnfor = .true. + wf_collect=.true. +/ +&SYSTEM + ibrav = 2, + celldm(1) = 10.21, + nat = 2, + ntyp = 1, + ecutwfc = 20 + nbnd = 5 +/ +&ELECTRONS + conv_thr = 1.D-8, + mixing_beta = 0.7D0 , +/ +ATOMIC_SPECIES + Si 28.086 Si.pz-vbc.UPF +ATOMIC_POSITIONS + Si 0.00 0.00 0.00 + Si 0.25 0.25 0.25 +K_POINTS + 10 + 0.1250000 0.1250000 0.1250000 1.00 + 0.1250000 0.1250000 0.3750000 3.00 + 0.1250000 0.1250000 0.6250000 3.00 + 0.1250000 0.1250000 0.8750000 3.00 + 0.1250000 0.3750000 0.3750000 3.00 + 0.1250000 0.3750000 0.6250000 6.00 + 0.1250000 0.3750000 0.8750000 6.00 + 0.1250000 0.6250000 0.6250000 3.00 + 0.3750000 0.3750000 0.3750000 1.00 + 0.3750000 0.3750000 0.6250000 3.00 +EOF + +echo -e "\tStart: " `date` +COMMAND=" $RUN_COMMAND pw.x" +echo -e "\t\t$COMMAND < $IN > $OUT" +$COMMAND < $IN > $OUT +echo -e "\tEnd: " `date` + +############################################################3 +# Calculate the bands + +IN=si_script.bands.in +OUT=si.bands.out +cat > $IN << EOF +&CONTROL + calculation = "bands", + prefix = "Si", + pseudo_dir = "$PSEUDO_DIR", + outdir = "$TMP_DIR", + tprnfor = .true. + wf_collect=.true. +/ +&SYSTEM + ibrav = 2, + celldm(1) = 10.21, + nat = 2, + ntyp = 1, + ecutwfc = 20 + nbnd = 8 +/ +&ELECTRONS + conv_thr = 1.D-8, + mixing_beta = 0.7D0 , +/ +ATOMIC_SPECIES + Si 28.086 Si.pz-vbc.UPF +ATOMIC_POSITIONS + Si 0.00 0.00 0.00 + Si 0.25 0.25 0.25 +K_POINTS {tpiba_b} + 6 + 0.500 0.500 0.500 8 ! L + 0.000 0.000 0.000 8 ! Gamma + 0.000 1.000 0.000 8 ! X + 0.250 1.000 0.250 1 ! U + 0.750 0.750 0.000 8 ! K + 0.000 0.000 0.000 1 ! Gamma +EOF + +echo -e "\tStart: " `date` +COMMAND=" $RUN_COMMAND pw.x" +echo -e "\t\t$COMMAND < $IN > $OUT" +$COMMAND < $IN > $OUT +echo -e "\tEnd: " `date` + +############################################################3 +# Post-processing + +IN=si_script.bandspp.in +OUT=si.bandspp.out +cat > $IN << EOF +&bands + prefix = "Si", + outdir='$TMP_DIR' + filband='Sibands.dat' + lsym=.true. + / +EOF + +echo -e "\tStart: " `date` +COMMAND=" $RUN_COMMAND bands.x" +echo -e "\t\t$COMMAND < $IN > $OUT" +$COMMAND < $IN > $OUT +echo -e "\tEnd: " `date` + + +IN=si_script.plotband.in +OUT=si.plotband.out +cat > $IN << EOF +Sibands.dat +-6.0 10.0 + +Sibands.ps +6.377 +1 6.377 +EOF + +echo -e "\tStart: " `date` +COMMAND="plotband.x" +echo -e "\t\t$COMMAND < $IN > $OUT" +$COMMAND < $IN > $OUT +echo -e "\tEnd: " `date` + +echo "Run completed at: " `date` + +rm -rf $TMP_DIR + +############################################################3 +# Plotting the bands + +IN=Sibands.gnuplot +cat > $IN << EOF +set title "Si band structure from Sibands.dat.gnu" +#high-symmetry point: 0.5000 0.5000 0.5000 x coordinate 0.0000 +#high-symmetry point: 0.0000 0.0000 0.0000 x coordinate 0.8660 +#high-symmetry point: 0.0000 1.0000 0.0000 x coordinate 1.8660 +#high-symmetry point: 0.2500 1.0000 0.2500 x coordinate 2.2196 +#high-symmetry point: 0.7500 0.7500 0.0000 x coordinate 2.2196 +#high-symmetry point: 0.0000 0.0000 0.0000 x coordinate 3.2802 +L=0.0000 +G1=0.8660 +X=1.8660 +U=2.2196 +G2=3.2802 +set xtics ("L" L,"{/Symbol G}" G1,"X" X,"U,K" U,"{/Symbol G}" G2) nomirror +set xrange [*:*] +set yrange [-13:4] +set grid x +set ylabel "Energy (eV)" +set nokey +EF = 6.377 +set term post enhanced +set out "Sibands-nosym.ps" +plot "Sibands.dat.gnu" u 1:(\$2-EF) with linespoints pointtype 7 pointsize 0.5,\ + 0 t "" w l lt 2 +set term pngcairo +set out "Sibands-nosym.png" +replot +set term dumb size 120,40 +set out +replot +set term qt +set out +replot +EOF + +echo -e "\tRunning gnuplot script: " `date` +gnuplot -p Sibands.gnuplot + +exit From 0efa4143b27d29409b238062dd69f20dec554f84 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 25 Jul 2024 13:03:00 +0200 Subject: [PATCH 2/7] Added QE to CI --- .github/workflows/software_repo_native.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/software_repo_native.yml b/.github/workflows/software_repo_native.yml index a676bbd..b668979 100644 --- a/.github/workflows/software_repo_native.yml +++ b/.github/workflows/software_repo_native.yml @@ -15,6 +15,7 @@ jobs: - OpenFOAM - TensorFlow - ESPResSo + - QuantumESPRESSO EESSI_VERSION: - "2023.06" steps: From 010503a3968021b293b29e901a4598c633166c59 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 25 Jul 2024 13:04:14 +0200 Subject: [PATCH 3/7] Removed QT display from gnuplot --- QuantumESPRESSO/run.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/QuantumESPRESSO/run.sh b/QuantumESPRESSO/run.sh index bfa5e6f..99f5403 100755 --- a/QuantumESPRESSO/run.sh +++ b/QuantumESPRESSO/run.sh @@ -183,19 +183,13 @@ set grid x set ylabel "Energy (eV)" set nokey EF = 6.377 -set term post enhanced -set out "Sibands-nosym.ps" -plot "Sibands.dat.gnu" u 1:(\$2-EF) with linespoints pointtype 7 pointsize 0.5,\ - 0 t "" w l lt 2 set term pngcairo set out "Sibands-nosym.png" -replot +plot "Sibands.dat.gnu" u 1:(\$2-EF) with linespoints pointtype 7 pointsize 0.5,\ + 0 t "" w l lt 2 set term dumb size 120,40 set out replot -set term qt -set out -replot EOF echo -e "\tRunning gnuplot script: " `date` From 655a0c5e930a77ed412af6a049c38e3190ca2c33 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 25 Jul 2024 13:04:50 +0200 Subject: [PATCH 4/7] Rename READEME.md to README.md --- QuantumESPRESSO/{READEME.md => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename QuantumESPRESSO/{READEME.md => README.md} (100%) diff --git a/QuantumESPRESSO/READEME.md b/QuantumESPRESSO/README.md similarity index 100% rename from QuantumESPRESSO/READEME.md rename to QuantumESPRESSO/README.md From 5261ade42686b7959a43eeb9a089fe6f97c6d730 Mon Sep 17 00:00:00 2001 From: crivella Date: Thu, 25 Jul 2024 13:08:03 +0200 Subject: [PATCH 5/7] Fix OMP env vars to avoid PSM3 nic --- QuantumESPRESSO/run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/QuantumESPRESSO/run.sh b/QuantumESPRESSO/run.sh index 99f5403..982941a 100755 --- a/QuantumESPRESSO/run.sh +++ b/QuantumESPRESSO/run.sh @@ -7,6 +7,12 @@ else exit 1 fi +export OMP_NUM_THREADS=1 +export OMPI_MCA_osc=^ucx +export OMPI_MCA_btl=^openib,ofi +export OMPI_MCA_pml=^ucx +export OMPI_MCA_mtl=^ofi + if [ ! -f Si.pz-vbc.UPF ]; then curl -OL http://pseudopotentials.quantum-espresso.org/upf_files/Si.pz-vbc.UPF fi From 3caedcd2d1eaabe6a34fc52faf7df7e5a6c526dd Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 25 Jul 2024 13:13:58 +0200 Subject: [PATCH 6/7] Update README.md --- QuantumESPRESSO/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QuantumESPRESSO/README.md b/QuantumESPRESSO/README.md index b4b0aac..0cd13c1 100644 --- a/QuantumESPRESSO/README.md +++ b/QuantumESPRESSO/README.md @@ -3,6 +3,6 @@ QuantumESPRESSO example This is an exemplified calculation of the band structure of silicon using QuantumESPRESSO. The calculation is performed in two steps: first, a self-consistent field calculation is performed to obtain the charge density, and then a non-self-consistent calculation is performed to obtain the band structure. The assumption is made that the proper convergence tests have already been performed and the lattice parameter has been optimized. -Example readapted form https://github.com/Crivella/DFT_QE_beginner_tutorial/tree/master/0_Si_bulk/4_bandstructure +Example re-adapted from https://github.com/Crivella/DFT_QE_beginner_tutorial/tree/master/0_Si_bulk/4_bandstructure -Runtime: ~5seconds on a single core +Runtime: ~5 seconds on a single core From 7e10bcf41f4e2dc5ea00e41be7915c13409a66c8 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 25 Jul 2024 13:14:20 +0200 Subject: [PATCH 7/7] Update README.md --- QuantumESPRESSO/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QuantumESPRESSO/README.md b/QuantumESPRESSO/README.md index 0cd13c1..18a507a 100644 --- a/QuantumESPRESSO/README.md +++ b/QuantumESPRESSO/README.md @@ -1,4 +1,4 @@ -QuantumESPRESSO example +# QuantumESPRESSO example This is an exemplified calculation of the band structure of silicon using QuantumESPRESSO. The calculation is performed in two steps: first, a self-consistent field calculation is performed to obtain the charge density, and then a non-self-consistent calculation is performed to obtain the band structure. The assumption is made that the proper convergence tests have already been performed and the lattice parameter has been optimized.