Skip to content

Commit

Permalink
Merge pull request #1083 from Iximiel/v2.8_qePatches
Browse files Browse the repository at this point in the history
Updating QE patches for v2.8
  • Loading branch information
GiovanniBussi committed May 28, 2024
2 parents 4408492 + 5c955e8 commit 62ef8cc
Show file tree
Hide file tree
Showing 24 changed files with 5,493 additions and 8 deletions.
13 changes: 9 additions & 4 deletions patches/qespresso-5.0.2.diff/PW/src/plugin_forces.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ SUBROUTINE plugin_forces()
USE plugin_flags
!
USE cell_base, ONLY : alat, at
USE ions_base, ONLY : tau, nat,amass
USE ions_base, ONLY : tau, nat, amass, ityp
USE force_mod, ONLY : force,sigma
USE control_flags, ONLY : istep
USE ener, ONLY : etot
!
IMPLICIT NONE
!
INTEGER:: i,j
INTEGER:: i,j,ia
REAL(DP) :: at_plumed(3,3)
REAL(DP) :: virial(3,3)
REAL(DP) :: volume
REAL(DP), ALLOCATABLE :: tau_plumed(:,:)
REAL(DP) :: masses_plumed(nat)
!
masses_plumed = 0.0_DP
IF(use_plumed) then
IF(ionode)THEN
at_plumed=alat*at; ! the cell, rescaled properly
Expand All @@ -44,9 +46,12 @@ SUBROUTINE plugin_forces()
-at_plumed(1,2)*at_plumed(3,3)*at_plumed(2,1) &
-at_plumed(1,3)*at_plumed(3,1)*at_plumed(2,2)
virial=-sigma*volume

! the masses in QE are stored per type, see q-e//Modules/ions_base.f90
do ia=1,nat
masses_plumed(ia)=amass(ityp(ia))
end do
CALL plumed_f_gcmd("setStep"//char(0),istep)
CALL plumed_f_gcmd("setMasses"//char(0),amass)
CALL plumed_f_gcmd("setMasses"//char(0),masses_plumed)
CALL plumed_f_gcmd("setForces"//char(0),force)
CALL plumed_f_gcmd("setPositions"//char(0),tau_plumed)
CALL plumed_f_gcmd("setBox"//char(0),at_plumed)
Expand Down
13 changes: 9 additions & 4 deletions patches/qespresso-6.2.diff/PW/src/plugin_ext_forces.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,21 @@ SUBROUTINE plugin_ext_forces()
USE plugin_flags
!
USE cell_base, ONLY : alat, at
USE ions_base, ONLY : tau, nat,amass
USE ions_base, ONLY : tau, nat, amass, ityp
USE force_mod, ONLY : force,sigma
USE control_flags, ONLY : istep
USE ener, ONLY : etot
!
IMPLICIT NONE
!
INTEGER:: i,j
INTEGER:: i,j,ia
REAL(DP) :: at_plumed(3,3)
REAL(DP) :: virial(3,3)
REAL(DP) :: volume
REAL(DP), ALLOCATABLE :: tau_plumed(:,:)
REAL(DP) :: masses_plumed(nat)
!
masses_plumed = 0.0_DP
IF(use_plumed) then
IF(ionode)THEN
at_plumed=alat*at; ! the cell, rescaled properly
Expand All @@ -43,9 +45,12 @@ SUBROUTINE plugin_ext_forces()
-at_plumed(1,2)*at_plumed(3,3)*at_plumed(2,1) &
-at_plumed(1,3)*at_plumed(3,1)*at_plumed(2,2)
virial=-sigma*volume

! the masses in QE are stored per type, see q-e//Modules/ions_base.f90
do ia=1,nat
masses_plumed(ia)=amass(ityp(ia))
end do
CALL plumed_f_gcmd("setStep"//char(0),istep)
CALL plumed_f_gcmd("setMasses"//char(0),amass)
CALL plumed_f_gcmd("setMasses"//char(0),masses_plumed)
CALL plumed_f_gcmd("setForces"//char(0),force)
CALL plumed_f_gcmd("setPositions"//char(0),tau_plumed)
CALL plumed_f_gcmd("setBox"//char(0),at_plumed)
Expand Down
28 changes: 28 additions & 0 deletions patches/qespresso-7.0.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@


function plumed_preliminary_test(){
# check if the README.md contains the word ESPRESSO and if qe has been already configured
grep -q ESPRESSO README.md 1>/dev/null 2>/dev/null && test -f make.inc
}

function plumed_before_patch(){
cp make.inc make.inc.plumedbck
PWD=`pwd`
echo "include ${PWD}/Plumed.inc ">make.inc
awk '{if($1=="QELIBS" && $2=="="){sub("=","= $(PLUMED_LOAD)"); print}else{print }}' make.inc.plumedbck >> make.inc
}

function plumed_after_revert(){
mv make.inc.plumedbck make.inc
}

function plumed_patch_info(){
echo ""
echo "For more information on Quantum Espresso you should visit http://www.quantum-espresso.org"
echo "To apply this patch configure Quantum Espresso by running ./configure first."
echo "The newer CMake installation workflow is not supported yet."
echo "To enable PLUMED on md runs use pw.x -plumed < md.in > md.out."
echo "A fixed PLUMED input file name 'plumed.dat' is used."
echo "This patch was kindly provided by Ralf Meyer, email: meyer.ralf(at)yahoo.com"
}

175 changes: 175 additions & 0 deletions patches/qespresso-7.0.diff/Modules/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#/a Makefile for Modules

include ../make.inc

# location of needed modules
MODFLAGS=$(BASEMOD_FLAGS) \
$(MOD_FLAG)../ELPA/src

# list of modules

MODULES = \
additional_kpoints.o \
autopilot.o \
basic_algebra_routines.o \
becmod.o \
bfgs_module.o \
bspline.o \
bz_form.o \
cell_base.o \
check_stop.o \
command_line_options.o \
compute_dipole.o \
constants.o \
constraints_module.o \
control_flags.o \
coulomb_vcut.o \
dist.o \
electrons_base.o \
environment.o \
fd_gradient.o \
fft_base.o \
fft_rho.o \
fsockets.o \
funct.o \
generate_function.o \
gradutils.o \
gvecw.o \
input_parameters.o \
invmat.o \
io_files.o \
io_global.o \
ions_base.o \
kind.o \
lmdif.o \
mdiis.o \
mm_dispersion.o \
mp_bands.o \
mp_exx.o \
mp_global.o \
mp_images.o \
mp_pools.o \
mp_wave.o \
mp_world.o \
noncol.o \
open_close_input_file.o \
parameters.o \
parser.o \
plugin_flags.o \
plugin_arguments.o \
plugin_variables.o \
pw_dot.o \
qmmm.o \
random_numbers.o \
read_cards.o \
read_input.o \
read_namelists.o \
read_pseudo.o \
recvec.o \
recvec_subs.o \
run_info.o \
space_group.o \
set_para_diag.o \
set_signal.o \
set_vdw_corr.o \
setqf.o \
timestep.o\
tsvdw.o\
mbdlib.o\
version.o \
wannier_gw.o\
wannier_new.o \
wavefunctions.o \
ws_base.o \
xc_vdW_DF.o \
xc_rVV10.o \
io_base.o \
qes_types_module.o \
qes_libs_module.o \
qes_write_module.o \
qes_read_module.o \
qes_reset_module.o \
qes_init_module.o \
qes_bcast_module.o \
qexsd.o \
qexsd_copy.o \
qexsd_init.o \
qexsd_input.o \
hdf5_qe.o\
qeh5_module.o\
fox_init_module.o \
xsf.o \
wyckoff.o \
wypos.o \
zvscal.o \
wave_gauge.o \
plumed.o

# list of subroutines and functions (not modules) previously found in flib/clib

OBJS = \
atom_weight.o \
capital.o \
cryst_to_car.o \
expint.o \
generate_k_along_lines.o \
has_xml.o \
inpfile.o \
int_to_char.o \
latgen.o \
linpack.o \
matches.o \
plot_io.o \
radial_gradients.o \
rgen.o \
recips.o \
remove_tot_torque.o \
set_hubbard_l.o \
set_hubbard_n.o \
sort.o \
trimcheck.o \
test_input_file.o \
date_and_tim.o \
volume.o \
wgauss.o \
w0gauss.o \
w1gauss.o \
deviatoric.o \
customize_signals.o \
qmmm_aux.o \
sockets.o \
stack.o

# GPU versions of modules
MODULES += \
wavefunctions_gpu.o \
becmod_gpu.o \
becmod_subs_gpu.o \
cuda_subroutines.o \
random_numbers_gpu.o

TLDEPS= libfox libutil libla libfft librxc

all : libqemod.a

## The following is needed only for lapack compiled from sources

dlamch.o : dlamch.f
$(F77) $(FFLAGS_NOOPT) -c $<

libqemod.a: $(MODULES) $(OBJS)
$(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@

tldeps :
if test -n "$(TLDEPS)" ; then \
( cd ../.. ; $(MAKE) $(TLDEPS) || exit 1 ) ; fi


clean :
- /bin/rm -f *.o *.a *.d *.i *~ *_tmp.f90 *.mod *.L plumed.f90

plumed.f90:
cp $(PLUMED_FORTRAN) plumed.f90

include make.depend
Loading

1 comment on commit 62ef8cc

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/performance-optimization.txt
Found broken examples in automatic/a-trieste-6.txt
Found broken examples in automatic/munster.txt
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in MiscelaneousPP.md

Please sign in to comment.