from PYXAID2 import *import os
user = 1 #weili or eric#user = 2 #alexey
nsteps_per_job = 2tot_nsteps = 4
# Step 1 - split MD trajectory on the time steps# IMPORTANT: # 1) use only ABSOLUTE path for PP in x.scf.in file# 2) provided input file is just a template, so do not include coordinatesrt="/home/export/parastor/keyuser/bnulongr/apps/test/test6/"# out2inp.out2inp(rt+"x.md.out","x0.scf.in","wd","x0.scf",0,tot_nsteps,1) # non-relativistic setup#out2inp.out2inp(rt+"GaAs-md.out","x1.scf.in","wd","x1.scf",0,tot_nsteps,1) # relativistic setupxdatcar2inp.xdatcar2inp(rt+"XDATCAR","x0.scf.in","wd","x0.scf",0,tot_nsteps,1)
# Step 2 - distribute all time steps into groups(jobs) # several time steps per group - this is to accelerate calculations# creates a "customized" submit file for each job and submit it - run# a swarm in independent calculations (trajectory pieces)#(HTC paradigm)# Provide the files below: # submit_templ.pbs - template for submit files - manually edit the variables# x.exp.in - file for export of the wavefunction
if user==1: os.system("cp submit.pbs wd")elif user==2: os.system("cp submit_templ.slm wd")
os.system("cp x0.exp.in wd")#os.system("cp x1.exp.in wd")os.chdir("wd")
if user==1: #distribute.distribute(0,tot_nsteps,nsteps_per_job,"submit.pbs",["x0.exp.in","x1.exp.in"],["x0.scf","x1.scf"],1) distribute.distribute(0,tot_nsteps,nsteps_per_job,"submit.pbs",["x0.exp.in"],["x0.scf"],1) #distribute.distribute(0,tot_nsteps,nsteps_per_job,"submit.pbs",["x1.exp.in"],["x1.scf"],1)# elif user==2: #distribute.distribute(0,tot_nsteps,nsteps_per_job,"submit_templ.slm",["x0.exp.in"],["x0.scf"],2) #distribute.distribute(0,tot_nsteps,nsteps_per_job,"submit_templ.slm",["x1.exp.in"],["x1.scf"],2) #distribute.distribute(0,tot_nsteps,nsteps_per_job,"submit_templ.slm",["x0.exp.in","x1.exp.in"],["x0.scf","x1.scf"],2)
#!/bin/bash#PBS -l nodes=1:ppn=2#PBS -N qe_pyxaid2_test#PBS -q q_zhq_bnulongr
cd $PBS_O_WORKDIRecho $PBS_O_WORKDIR
# the below settings works for my laptop, please customize your own environmental variables!###### some conventional settings ###########export PYTHONPATH=/home/export/parastor/keyuser/bnulongr/apps/libra/bin/src:$PYTHONPATHexport LD_LIBRARY_PATH=/home/export/parastor/keyuser/bnulongr/apps/libra/bin/src:$LD_LIBRARY_PATHexport PYTHONPATH=/home/export/parastor/keyuser/bnulongr/apps/pyxaid2-master:$PYTHONPATHexport LD_LIBRARY_PATH=/home/export/parastor/keyuser/bnulongr/apps/pyxaid2-master:/home/export/parastor/keyuser/bnulongr/apps/boost1.6/lib:$LD_LIBRARY_PATHexport LD_LIBRARY_PATH=/home/export/parastor/clussoft/compiler/intel/composer_xe_2015.2.164/mkl/lib/intel64:$LD_LIBRARY_PATH##### path for the QE module #####exe_qespresso=/home/export/parastor/keyuser/bnulongr/apps/qe/5.3.0/espresso-5.3.0/bin/pw.xexe_export=/home/export/parastor/keyuser/bnulongr/apps/qe/5.3.0/espresso-5.3.0/bin/pw_export.xexe_convert=/home/export/parastor/keyuser/bnulongr/apps/qe/5.3.0/espresso-5.3.0/bin/iotk##### MPI #####source /home/export/parastor/clussoft/profile.d/intelmpi.sh MPIRUN=/home/export/parastor/clussoft/mpi/intelmpi/5.0.2.044/intel64/bin/mpirunNP=$(wc -l $PBS_NODEFILE | awk '{print $1}')
# These will be assigned automatically, leave them as they areparam1=param2=
res=/home/export/parastor/keyuser/bnulongr/apps/test/test6/res
# This is invocation of the scripts which will further handle NA-MD calclculations# on the NAC calculation steppython -c "from PYXAID2 import *params = { }params[\"BATCH_SYSTEM\"]=\"$MPIRUN\"params[\"NP\"]=$NPparams[\"EXE\"]=\"$exe_qespresso\"params[\"EXE_EXPORT\"]=\"$exe_export\"params[\"EXE_CONVERT\"] =\"$exe_convert\"params[\"start_indx\"]=$param1params[\"stop_indx\"]=$param2params[\"wd\"]=\"wd_test\"params[\"rd\"]=\"$res\"params[\"minband\"]=351params[\"maxband\"]=352params[\"minband_soc\"]=351params[\"maxband_soc\"]=352params[\"nac_method\"]=0params[\"wfc_preprocess\"]=\"complete\"params[\"do_complete\"]=1params[\"prefix0\"]=\"x0.scf\"params[\"prefix1\"]=\"x1.scf\"params[\"compute_Hprime\"]=1params[\"pptype\"]=\"US\"print paramsrunMD2.runMD(params)"
&CONTROL calculation = 'scf', pseudo_dir = '/home/export/parastor/keyuser/bnulongr/soft/qe/upf_files', outdir = './', prefix = 'x0', disk_io = 'low', wf_collect = .true./
&SYSTEM ibrav = 0,! celldm(1) = 1.88973, nat = 78, ntyp = 2,! nspin = 2, nbnd = 20, ecutwfc = 30, tot_charge = 0.0,! starting_magnetization(1) = 0.01 occupations = 'smearing', smearing = 'gaussian', degauss = 0.005, nosym = .true.,/
&ELECTRONS electron_maxstep = 300, conv_thr = 1.D-5, mixing_beta = 0.45,/
&IONS ion_dynamics = 'verlet', ion_temperature = 'andersen', tempw = 300.00 , nraise = 1,/
ATOMIC_SPECIES Zn 65.3799972534 Zn.pbe-van.UPF S 32.0600013733 S.pbe-n-kjpaw_psl.0.1.UPF
K_POINTS {gamma} CELL_PARAMETERS {angstrom} 19.7647991179999991 0.0000000000000000 0.0000000000000000 0.0000000000000000 19.0186996460000017 0.0000000000000000 0.0000000000000000 0.0000000000000000 18.7049007415999995
&inputpp prefix = 'x0', outdir = './', pseudo_dir = '/home/export/parastor/keyuser/bnulongr/soft/qe/upf_files', psfile(1) = 'Zn.pbe-van.UPF', psfile(2) = 'S.pbe-n-kjpaw_psl.0.1.UPF', single_file = .FALSE., ascii = .TRUE., uspp_spsi = .FALSE.,/