labs: update to dimer script for basics lab

git-svn-id: https://subversion.assembla.com/svn/qmcdev/trunk@6904 e5b18d87-469d-4833-9cc0-8cdfa06e9491
This commit is contained in:
Jaron Krogel 2016-05-16 18:39:10 +00:00
parent fd1818c6cc
commit 2d9bfd51f4
1 changed files with 102 additions and 69 deletions

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python
# import project suite functions
from project import settings,Job,get_machine,run_project
from project import generate_physical_system
from project import generate_qmcpack,loop,linear,vmc,dmc
# import Nexus functions
from nexus import settings,job,get_machine,run_project
from nexus import generate_physical_system
from nexus import generate_pwscf,generate_pw2qmcpack
from nexus import generate_qmcpack,loop,linear,vmc,dmc
# project suite settings
# Nexus settings
settings(
pseudo_dir = './pseudopotentials',
runs = '',
@ -13,21 +14,25 @@ settings(
status_only = 0,
generate_only = 0,
sleep = 3,
#machine = 'ws4',
machine = 'vesta',
account = 'QMC_2014_training'
account = 'QMCPACK-Training',
)
# allow max of one job at a time (lab only)
vesta = get_machine('vesta')
vesta.queue_size = 1
# specify job details
if settings.machine.startswith('ws'): # running on workstation
dftjob = job(cores=4,app='pw.x')
p2qjob = job(cores=1,app='pw2qmcpack.x')
qmcjob = job(cores=4,app='qmcpack')
else: # running on Vesta
appdir = '/soft/applications/qmcpack/Binaries/'
dftjob = job(nodes= 4,threads= 1,hours=1,app=appdir+'pw.x')
p2qjob = job(cores= 1,threads= 1,hours=1,app=appdir+'pw2qmcpack.x')
qmcjob = job(nodes=32,threads=16,hours=1,app=appdir+'qmcpack')
# specify job parameters
qmcjob = Job(
nodes = 32,
threads = 16,
hours = 1,
app = '/soft/applications/qmcpack/build_XL_real/bin/qmcapp'
)
vesta = get_machine('vesta') # allow one job at a time (lab only)
vesta.queue_size = 1
#end if
# specify optimization parameters
linopt1 = linear(
@ -35,7 +40,7 @@ linopt1 = linear(
unreweightedvariance = 1.0,
reweightedvariance = 0.0,
timestep = 0.4,
samples = 5120, # opt w/ 5120 samples
samples = 10240, # opt w/ 10240 samples
warmupsteps = 50,
blocks = 200,
substeps = 1,
@ -52,18 +57,14 @@ linopt1 = linear(
alloweddifference = 1e-4,
stepsize = 0.2,
stabilizerscale = 1.0,
nstabilizers = 3
nstabilizers = 3,
)
linopt2 = linopt1.copy()
linopt2.samples = 20480 # opt w/ 20000 samples
linopt2.samples = 61440 # opt w/ 61440 samples
linopt3 = linopt1.copy()
linopt3.samples = 40960 # opt w/ 40000 samples
opt_calcs = [loop(max=8,qmc=linopt1), # loops over opt's
loop(max=6,qmc=linopt2),
loop(max=4,qmc=linopt3)]
opt_calcs = [loop(max=4,qmc=linopt1), # loops over opt's
loop(max=8,qmc=linopt2)]
# specify DMC parameters
qmc_calcs = [
@ -81,57 +82,89 @@ qmc_calcs = [
blocks = 400,
steps = 32,
timestep = 0.01,
nonlocalmoves = True
nonlocalmoves = True,
)
]
# create opt & DMC sim's for each bond length
# create DFT, OPT, & DMC sim's for each bond length
sims = []
scale = 1.00
directory = 'scale_'+str(scale)
scales = [1.00]
for scale in scales:
directory = 'scale_'+str(scale)
# make stretched/compressed dimer
dimer = generate_physical_system(
type = 'dimer',
dimer = ('O','O'),
separation = 1.2074*scale,
Lbox = 15.0,
units = 'A',
net_spin = 2,
O = 6
)
# make stretched/compressed dimer
dimer = generate_physical_system(
type = 'dimer',
dimer = ('O','O'),
separation = 1.2074*scale,
Lbox = 15.0,
units = 'A',
net_spin = 2,
O = 6,
)
# describe optimization run
opt = generate_qmcpack(
identifier = 'opt',
path = directory,
system = dimer,
job = qmcjob,
input_type = 'basic',
pseudos = ['O.BFD.xml'],
orbitals_h5 = 'O2.pwscf.h5',
bconds = 'nnn',
jastrows = [('J1','bspline',8,4.5), # 1 & 2 body Jastrows
('J2','pade',0.5,0.5)],
calculations = opt_calcs
)
sims.append(opt)
# describe DFT run
dft = generate_pwscf(
identifier = 'dft',
path = directory,
job = dftjob,
system = dimer,
input_type = 'scf',
pseudos = ['O.BFD.upf'],
input_dft = 'lda',
ecut = 200,
conv_thr = 1e-7,
mixing_beta = .7,
nosym = True,
wf_collect = True,
)
sims.append(dft)
# describe DMC run
qmc = generate_qmcpack(
identifier = 'qmc',
path = directory,
system = dimer,
job = qmcjob,
input_type = 'basic',
pseudos = ['O.BFD.xml'],
orbitals_h5 = 'O2.pwscf.h5',
bconds = 'nnn',
jastrows = [],
calculations = qmc_calcs,
dependencies = (opt,'jastrow') # Jastrows result from opt
)
sims.append(qmc)
# describe orbital conversion run
p2q = generate_pw2qmcpack(
identifier = 'p2q',
path = directory,
job = p2qjob,
write_psir = False,
dependencies = (dft,'orbitals'),
)
sims.append(p2q)
# describe optimization run
if scale==1.00: # use eqm. Jastrow for all bond lengths
opt = generate_qmcpack(
identifier = 'opt',
path = directory,
job = qmcjob,
system = dimer,
input_type = 'basic',
pseudos = ['O.BFD.xml'],
orbitals_h5 = 'O2.pwscf.h5',
bconds = 'nnn',
jastrows = [('J1','bspline',8,4.5), # 1 & 2 body Jastrows
('J2','pade',0.5,0.5)],
calculations = opt_calcs,
dependencies = (p2q,'orbitals'),
)
sims.append(opt)
#end if
# describe DMC run
qmc = generate_qmcpack(
identifier = 'qmc',
path = directory,
job = qmcjob,
system = dimer,
input_type = 'basic',
pseudos = ['O.BFD.xml'],
orbitals_h5 = 'O2.pwscf.h5',
bconds = 'nnn',
jastrows = [],
calculations = qmc_calcs,
dependencies = [(p2q,'orbitals'),(opt,'jastrow') ],
)
sims.append(qmc)
#end for
# execute all simulations
run_project(sims)