Dice Player Translation, Initial work on Dice Processes

This commit adds the functions responsible for creating Dice inputs and calling dice it self, the original functions were removed from the Dice.py file and added to SetGlobals' Internal and Dice classes

Signed-off-by: Vitor Hideyoshi <vitor.h.n.batista@gmail.com>
This commit is contained in:
2021-11-05 16:06:31 +00:00
parent f5e4c7ba1f
commit 0d877e3dce
24 changed files with 700 additions and 3382 deletions

View File

@@ -9,13 +9,6 @@ from DPpack.PTable import *
from DPpack.SetGlobals import *
from DPpack.Misc import *
dice_end_flag = "End of simulation" ## The normal end flag
dice_flag_line = -2 ## must be in the line before the last
umaAng3_to_gcm3 = 1.6605 ## Conversion between uma/Ang3 to g/cm3
max_seed = 4294967295 ## Maximum allowed value for a seed (numpy)
####################################### functions ######################################
def make_inputs(cycle, proc):

View File

@@ -25,7 +25,7 @@ class System:
self.molecule = []
self.nmols = []
def add_type(self,nmols, m):
def add_type(self, nmols, m):
self.molecule.append(m)
self.nmols.append(nmols)
@@ -189,21 +189,30 @@ class System:
class Molecule:
def __init__(self):
def __init__(self, molname):
self.molname = molname
self.atom = [] # Lista de instancias de Atom
self.position = None # Array Numpy
self.energy = None # Array Numpy
self.gradient = None # Array Numpy
self.hessian = None # Array Numpy
self.total_mass = 0
self.com = None
self.ghost_atoms = [] # Stores the index of the ghost atoms in the atoms array
self.lp_atoms = []
def add_atom(self, a):
self.atom.append(a) # Inserção de um novo atomo
self.total_mass += a.mass
if (a.na == ghost_number):
self.ghost_atoms.append(self.atom.index(a))
self.center_of_mass()
def center_of_mass(self):

View File

@@ -3,10 +3,23 @@ import shutil
import textwrap
import types
from numpy.core.fromnumeric import partition
from DPpack.MolHandling import *
from DPpack.PTable import *
from DPpack.Misc import *
from numpy import random
import subprocess
dice_end_flag = "End of simulation" ## The normal end flag
dice_flag_line = -2 ## must be in the line before the last
umaAng3_to_gcm3 = 1.6605 ## Conversion between uma/Ang3 to g/cm3
max_seed = 4294967295 ## Maximum allowed value for a seed (numpy)
class Internal:
def __init__(self, infile, outfile):
@@ -38,7 +51,7 @@ class Internal:
## Dice:
self.combrule = None
self.randominit = None
self.randominit = True
def read_keywords(self):
@@ -60,8 +73,17 @@ class Internal:
if key in self.player_keywords and len(value) != 0: ## 'value' is not empty!
if key == 'qmprog' and value[0].lower() in ("g03", "g09", "g16", "molcas"):
setattr(self.player, key, value[0].lower())
if self.player.qmprog in ("g03","g09","g16"):
self.gaussian.qmprog = self.player.qmprog
# if self.player.qmprog == "molcas":
# pass
elif key == 'opt' and value[0].lower() in ("yes", "no", "ts"):
setattr(self.player, key, value[0].lower())
@@ -208,7 +230,6 @@ class Internal:
# #### End
def check_keywords(self):
min_steps = 20000
@@ -388,12 +409,14 @@ class Internal:
for i in range(ntypes):
line += 1
nsites = ljfile.pop(0).split()[0]
nsites, molname = ljfile.pop(0).split()[:2]
if not nsites.isdigit():
sys.exit("Error: expected an integer in line {} of file {}".format(line, self.dice.ljname))
nsites = int(nsites)
self.system.add_type(nsites,Molecule())
self.system.add_type(nsites, Molecule(molname))
for j in range(nsites):
@@ -466,7 +489,6 @@ class Internal:
if _var in locals() or _var in globals():
exec(f'del {_var}')
def print_potential(self):
formatstr = "{:<3d} {:>3d} {:>10.5f} {:>10.5f} {:>10.5f} {:>10.6f} {:>9.5f} {:>7.4f} {:>9.4f}\n"
@@ -575,7 +597,6 @@ class Internal:
else:
sys.exit("Error: cannot find formchk executable")
def calculate_step(self):
invhessian = linalg.inv(self.system.molecule[0].hessian)
@@ -634,7 +655,7 @@ class Internal:
pass
### I still have to talk with Herbet about
### I still have to talk with Herbet about this function
def populate_asec_vdw(self, cycle):
asec_charges = [] # (rx, ry, rz, chg)
@@ -647,11 +668,11 @@ class Internal:
norm_factor = nconfigs * self.player.nprocs
nsitesref = len(self.system.molecule[0]) + len(ghost_atoms) + len(lp_atoms)
nsitesref = len(self.system.molecule[0].atom) + len(self.system.molecule[0].ghost_atoms) + len(self.system.molecule[0].lp_atoms)
nsites_total = self.dice.nmol[0] * nsitesref
for i in range(1, len(self.dice.nmol)):
nsites_total += self.dice.nmol[i] * len(self.system.molecule[i])
nsites_total += self.dice.nmol[i] * len(self.system.molecule[i].atom)
thickness = []
picked_mols = []
@@ -691,7 +712,7 @@ class Internal:
for mol in range(nmols): ## Run over molecules of each type
new_molecule = []
for site in range(len(self.system.molecule[types].atoms)): ## Run over sites of each molecule
for site in range(len(self.system.molecule[types].atom)): ## Run over sites of each molecule
new_molecule.append({})
line = xyzfile.pop(0).split()
@@ -771,6 +792,333 @@ class Internal:
return asec_charges
## Dice related Upper fuctions
def print_last_config(self, cycle, proc):
step_dir = "step{:02d}".format(cycle)
proc_dir = "p{:02d}".format(proc)
path = step_dir + os.sep + proc_dir
file = path + os.sep + self.dice.outname + ".xyz"
if not os.path.isfile(file):
sys.exit("Error: cannot find the xyz file {}".format(file))
try:
with open(file) as fh:
xyzfile = fh.readlines()
except:
sys.exit("Error: cannot open file {}".format(file))
nsites = len(self.system.molecule[0].atom) * self.dice.nmol[0]
for i in range(1, len(self.dice.nmol)):
nsites += self.dice.nmol[i] * len(self.system.molecule[i].atom)
nsites += 2 ## To include the comment line and the number of atoms (xyz file format)
nsites *= -1 ## Become an index to count from the end of xyzfile (list)
xyzfile = xyzfile[nsites :] ## Take the last configuration
file = self.dice.outname + ".xyz.last-" + proc_dir
fh = open(file, "w")
for line in xyzfile:
fh.write(line)
def new_density(self, proc):
file = self.dice.outname + ".xyz.last-" + "p{:02d}".format(proc)
if not os.path.isfile(file):
sys.exit("Error: cannot find the xyz file {} in main directory".format(file))
try:
with open(file) as fh:
xyzfile = fh.readlines()
except:
sys.exit("Error: cannot open file {}".format(file))
box = xyzfile[1].split()
volume = float(box[-3]) * float(box[-2]) * float(box[-1])
total_mass = 0
for i in range(len(self.system.molecule)):
total_mass += self.system.molecule[i].total_mass * self.dice.nmol[i]
density = (total_mass / volume) * umaAng3_to_gcm3
return density
def simulation_process(self, cycle, proc):
try:
self.dice.make_proc_dir(cycle, proc)
self.make_inputs(cycle, proc)
self.dice.run_dice(cycle, proc, self.outfile)
except Exception as err:
sys.exit(err)
def make_inputs(self, cycle, proc):
step_dir = "step{:02d}".format(cycle)
proc_dir = "p{:02d}".format(proc)
path = step_dir + os.sep + proc_dir
num = time.time() ## Take the decimal places 7 to 12 of the
num = (num - int(num)) * 1e6 ## time in seconds as a floating point
num = int((num - int(num)) * 1e6) ## to make an integer in the range 1-1e6
random.seed( (os.getpid() * num) % (max_seed + 1) )
if self.randominit == False or self.player.cyc > 1:
xyzfile = self.dice.outname + ".xyz.last-" + "p{:02d}".format(proc)
self.make_init_file(path, xyzfile)
if len(self.dice.nstep) == 2: ## Means NVT simulation
self.make_nvt_ter(path)
self.make_nvt_eq(path)
elif len(self.dice.nstep) == 3: ## Means NPT simulation
if self.randominit:
self.make_nvt_ter(path)
else:
self.dens = self.new_density(proc)
self.make_npt_ter(path)
self.make_npt_eq(path)
else:
sys.exit("Error: bad number of entries for 'nstep'")
self.make_potential(path)
def make_nvt_ter(self,path):
file = path + os.sep + "NVT.ter"
try:
fh = open(file, "w")
except:
sys.exit("Error: cannot open file {}".format(file))
fh.write("title = {} - NVT Thermalization\n".format(self.dice.title))
fh.write("ncores = {}\n".format(self.dice.ncores))
fh.write("ljname = {}\n".format(self.dice.ljname))
fh.write("outname = {}\n".format(self.dice.outname))
string = " ".join(str(x) for x in self.dice.nmol)
fh.write("nmol = {}\n".format(string))
fh.write("dens = {}\n".format(self.dice.dens))
fh.write("temp = {}\n".format(self.dice.temp))
if self.randominit:
fh.write("init = yes\n")
fh.write("nstep = {}\n".format(self.dice.nstep[0]))
else:
fh.write("init = yesreadxyz\n")
fh.write("nstep = {}\n".format(self.player.altsteps))
fh.write("vstep = 0\n")
fh.write("mstop = 1\n")
fh.write("accum = no\n")
fh.write("iprint = 1\n")
fh.write("isave = 0\n")
fh.write("irdf = 0\n")
seed = int(1e6 * random.random())
fh.write("seed = {}\n".format(seed))
fh.write("upbuf = {}".format(self.dice.upbuf))
fh.close()
def make_nvt_eq(self, path):
file = path + os.sep + "NVT.eq"
try:
fh = open(file, "w")
except:
sys.exit("Error: cannot open file {}".format(file))
fh.write("title = {} - NVT Production\n".format(self.dice.title))
fh.write("ncores = {}\n".format(self.dice.ncores))
fh.write("ljname = {}\n".format(self.dice.ljname))
fh.write("outname = {}\n".format(self.dice.outname))
string = " ".join(str(x) for x in self.dice.nmol)
fh.write("nmol = {}\n".format(string))
fh.write("dens = {}\n".format(self.dice.dens))
fh.write("temp = {}\n".format(self.dice.temp))
fh.write("init = no\n")
fh.write("nstep = {}\n".format(self.dice.nstep[1]))
fh.write("vstep = 0\n")
fh.write("mstop = 1\n")
fh.write("accum = no\n")
fh.write("iprint = 1\n")
fh.write("isave = {}\n".format(self.isave))
fh.write("irdf = {}\n".format(10 * self.player.nprocs))
seed = int(1e6 * random.random())
fh.write("seed = {}\n".format(seed))
fh.close()
def make_npt_ter(self,path):
file = path + os.sep + "NPT.ter"
try:
fh = open(file, "w")
except:
sys.exit("Error: cannot open file {}".format(file))
fh.write("title = {} - NPT Thermalization\n".format(self.dice.title))
fh.write("ncores = {}\n".format(self.dice.ncores))
fh.write("ljname = {}\n".format(self.dice.ljname))
fh.write("outname = {}\n".format(self.dice.outname))
string = " ".join(str(x) for x in self.dice.nmol)
fh.write("nmol = {}\n".format(string))
fh.write("press = {}\n".format(self.dice.press))
fh.write("temp = {}\n".format(self.dice.temp))
if self.dice.randominit == True:
fh.write("init = no\n") ## Because there will be a previous NVT simulation
fh.write("vstep = {}\n".format(int(self.dice.nstep[1] / 5)))
else:
fh.write("init = yesreadxyz\n")
fh.write("dens = {:<8.4f}\n".format(self.dice.dens))
fh.write("vstep = {}\n".format(int(self.player.altsteps / 5)))
fh.write("nstep = 5\n")
fh.write("mstop = 1\n")
fh.write("accum = no\n")
fh.write("iprint = 1\n")
fh.write("isave = 0\n")
fh.write("irdf = 0\n")
seed = int(1e6 * random.random())
fh.write("seed = {}\n".format(seed))
fh.close()
def make_npt_eq(self, path):
file = path + os.sep + "NPT.eq"
try:
fh = open(file, "w")
except:
sys.exit("Error: cannot open file {}".format(file))
fh.write("title = {} - NPT Production\n".format(self.dice.title))
fh.write("ncores = {}\n".format(self.dice.ncores))
fh.write("ljname = {}\n".format(self.dice.ljname))
fh.write("outname = {}\n".format(self.dice.outname))
string = " ".join(str(x) for x in self.dice.nmol)
fh.write("nmol = {}\n".format(string))
fh.write("press = {}\n".format(self.dice.press))
fh.write("temp = {}\n".format(self.dice.temp))
fh.write("nstep = 5\n")
fh.write("vstep = {}\n".format(int(self.dice.nstep[2] / 5)))
fh.write("init = no\n")
fh.write("mstop = 1\n")
fh.write("accum = no\n")
fh.write("iprint = 1\n")
fh.write("isave = {}\n".format(self.dice.isave))
fh.write("irdf = {}\n".format(10 * self.player.nprocs))
seed = int(1e6 * random.random())
fh.write("seed = {}\n".format(seed))
fh.close()
def make_init_file(self, path, file):
if not os.path.isfile(file):
sys.exit("Error: cannot find the xyz file {} in main directory".format(file))
try:
with open(file) as fh:
xyzfile = fh.readlines()
except:
sys.exit("Error: cannot open file {}".format(file))
nsites_mm = 0
for i in range(1, len(self.dice.nmol)):
nsites_mm += self.dice.nmol[i] * len(self.system.molecule[i].atom)
nsites_mm *= -1 ## Become an index to count from the end of xyzfile (list)
xyzfile = xyzfile[nsites_mm :] ## Only the MM atoms of the last configuration remains
file = path + os.sep + self.dice.outname + ".xy"
try:
fh = open(file, "w")
except:
sys.exit("Error: cannot open file {}".format(file))
for atom in self.system.molecule[0].atom:
fh.write("{:>10.6f} {:>10.6f} {:>10.6f}\n".format(atom.rx, atom.ry, atom.rz))
for i in self.system.molecule[0].ghost_atoms:
with self.system.molecule[0].atom[i] as ghost:
fh.write("{:>10.6f} {:>10.6f} {:>10.6f}\n".format(ghost.rx, ghost.ry, ghost.rz))
for i in self.system.molecule[0].lp_atoms:
with self.system.molecule[0].atom[i] as lp:
fh.write("{:>10.6f} {:>10.6f} {:>10.6f}\n".format(lp.rx, lp.ry, lp.rz))
for line in xyzfile:
atom = line.split()
rx = float(atom[1])
ry = float(atom[2])
rz = float(atom[3])
fh.write("{:>10.5f} {:>10.5f} {:>10.5f}\n".format(rx, ry, rz))
fh.write("$end")
fh.close()
def make_potential(self, path):
fstr = "{:<3d} {:>3d} {:>10.5f} {:>10.5f} {:>10.5f} {:>10.6f} {:>9.5f} {:>7.4f}\n"
file = path + os.sep + self.dice.ljname
try:
fh = open(file, "w")
except:
sys.exit("Error: cannot open file {}".format(file))
fh.write("{}\n".format(self.dice.combrule))
fh.write("{}\n".format(len(self.dice.nmol)))
nsites_qm = len(self.system.molecule[0].atom) + len(self.system.molecule[0].ghost_atoms) + len(self.system.molecule[0].lp_atoms)
## Print the sites of the QM molecule
fh.write("{} {}\n".format(nsites_qm, self.system.molecule[0].molname))
for atom in self.system.molecule[0].atom:
fh.write(fstr.format(atom.lbl, atom.na, atom.rx, atom.ry, atom.rz,
atom.chg, atom.eps, atom.sig))
ghost_label = self.system.molecule[0].atom[-1].lbl + 1
for i in self.system.molecule[0].ghost_atoms:
fh.write(fstr.format(ghost_label, ghost_number, self.system.molecule[0].atom[i].rx, self.system.molecule[0].atom[i].ry,
self.system.molecule[0].atom[i].rz, self.system.molecule[0].atom[i].chg, 0, 0))
ghost_label += 1
for lp in self.system.molecule[0].lp_atoms:
fh.write(fstr.format(ghost_label, ghost_number, lp['rx'], lp['ry'], lp['rz'],
lp['chg'], 0, 0))
## Print the sites of the other molecules
for mol in self.system.molecule[1:]:
fh.write("{} {}\n".format(len(mol.atom), mol.molname))
for atom in mol.atom:
fh.write(fstr.format(atom.lbl, atom.na, atom.rx, atom.ry,
atom.rz, atom.chg, atom.eps, atom.sig))
class Player:
def __init__(self):
@@ -799,6 +1147,7 @@ class Internal:
self.progname = "dice"
self.path = None
self.init = "yes"
self.temp = 300.0
self.press = 1.0
self.isave = 1000 # ASEC construction will take this into account
@@ -814,7 +1163,162 @@ class Internal:
self.nstep = [] # 2 or 3 integer values related to 2 or 3 simulations
# (NVT th + NVT eq) or (NVT th + NPT th + NPT eq).
# This will control the 'nstep' keyword of Dice
self.upbuf = 360
def make_proc_dir(self, cycle, proc):
step_dir = "step{:02d}".format(cycle)
proc_dir = "p{:02d}".format(proc)
path = step_dir + os.sep + proc_dir
try:
os.makedirs(path)
except:
sys.exit("Error: cannot make directory {}".format(path))
return
def run_dice(self, cycle, proc, fh):
step_dir = "step{:02d}".format(cycle)
proc_dir = "p{:02d}".format(proc)
try:
fh.write("Simulation process {} initiated with pid {}\n".format(step_dir+'/'+proc_dir, os.getpid()))
fh.flush()
except Exception as err:
print("I/O error({0}): {1}".format(err))
path = step_dir + os.sep + proc_dir
working_dir = os.getcwd()
os.chdir(path)
if len(self.nstep) == 2: ## Means NVT simulation
## NVT thermalization
string = "(from " + ("random" if self.randominit else "previous") + " configuration)"
fh.write("p{:02d}> NVT thermalization initiated {} on {}\n".format(proc, string,
date_time()))
infh = open("NVT.ter")
outfh = open("NVT.ter.out", "w")
exit_status = subprocess.call(self.progname, stdin=infh, stdout=outfh)
infh.close()
outfh.close()
if os.getppid() == 1: ## Parent process is dead
sys.exit()
if exit_status != 0:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
else:
outfh = open("NVT.ter.out") ## Open again to seek the normal end flag
flag = outfh.readlines()[dice_flag_line].strip()
outfh.close()
if flag != dice_end_flag:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
## NVT production
fh.write("p{:02d}> NVT production initiated on {}\n".format(proc, date_time()))
infh = open("NVT.eq")
outfh = open("NVT.eq.out", "w")
exit_status = subprocess.call(self.progname, stdin=infh, stdout=outfh)
infh.close()
outfh.close()
if os.getppid() == 1: ## Parent process is dead
sys.exit()
if exit_status != 0:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
else:
outfh = open("NVT.eq.out") ## Open again to seek the normal end flag
flag = outfh.readlines()[dice_flag_line].strip()
outfh.close()
if flag != dice_end_flag:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
fh.write("p{:02d}> ----- NVT production finished on {}\n".format(proc,
date_time()))
elif len(self.nstep) == 3: ## Means NPT simulation
## NVT thermalization if randominit
if self.randominit:
string = "(from random configuration)"
fh.write("p{:02d}> NVT thermalization initiated {} on {}\n".format(proc,
string, date_time()))
infh = open("NVT.ter")
outfh = open("NVT.ter.out", "w")
exit_status = subprocess.call(self.progname, stdin=infh, stdout=outfh)
infh.close()
outfh.close()
if os.getppid() == 1: ## Parent process is dead
sys.exit()
if exit_status != 0:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
else:
outfh = open("NVT.ter.out") ## Open again to seek the normal end flag
flag = outfh.readlines()[dice_flag_line].strip()
outfh.close()
if flag != dice_end_flag:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
## NPT thermalization
string = (" (from previous configuration) " if not self.randominit else " ")
fh.write("p{:02d}> NPT thermalization initiated{}on {}\n".format(proc, string,
date_time()))
fh.flush()
infh = open("NPT.ter")
outfh = open("NPT.ter.out", "w")
exit_status = subprocess.call(self.progname, stdin=infh, stdout=outfh)
infh.close()
outfh.close()
if os.getppid() == 1: ## Parent process is dead
sys.exit()
if exit_status != 0:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
else:
outfh = open("NPT.ter.out") ## Open again to seek the normal end flag
flag = outfh.readlines()[dice_flag_line].strip()
outfh.close()
if flag != dice_end_flag:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
## NPT production
fh.write("p{:02d}> NPT production initiated on {}\n".format(proc, date_time()))
infh = open("NPT.eq")
outfh = open("NPT.eq.out", "w")
exit_status = subprocess.call(self.progname, stdin=infh, stdout=outfh)
infh.close()
outfh.close()
if os.getppid() == 1: ## Parent process is dead
sys.exit()
if exit_status != 0:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
else:
outfh = open("NPT.eq.out") ## Open again to seek the normal end flag
flag = outfh.readlines()[dice_flag_line].strip()
outfh.close()
if flag != dice_end_flag:
sys.exit("Dice process p{:02d} did not exit properly".format(proc))
fh.write("p{:02d}> ----- NPT production finished on {}\n".format(proc,
date_time()))
os.chdir(working_dir)
class Gaussian:

View File

@@ -2,20 +2,21 @@
initcyc = 1
maxcyc = 3
opt = NO
nprocs = 2
qmprog = g09
nprocs = 4
qmprog = g16
lps = no
ghosts = no
altsteps = 20000
# dice
ncores = 1
ncores = 3
nmol = 1 100
dens = 0.75
nstep = 40000 60000 50000
isave = 1000
ljname = phb.pot
outname = phb
init = yes
# Gaussian
level = MP2/aug-cc-pVTZ

View File

@@ -96,7 +96,7 @@ if __name__ == '__main__':
for i in range(len(internal.system.molecule)):
internal.outfile.write("\nMolecule type {}:\n\n".format(i + 1))
internal.outfile.write("\nMolecule type {} - {}:\n\n".format(i + 1, internal.system.molecule[i].molname))
internal.system.molecule[i].print_mol_info(internal.outfile)
internal.outfile.write(" Translating and rotating molecule to standard orientation...")
internal.system.molecule[i].standard_orientation()
@@ -120,82 +120,83 @@ if __name__ == '__main__':
except EnvironmentError as err:
sys.exit(err)
# internal.outfile.write("\nStarting the iterative process.\n")
internal.outfile.write("\nStarting the iterative process.\n")
# ## Initial position (in Bohr)
# position = internal.system.molecule[0].read_position()
## Initial position (in Bohr)
position = internal.system.molecule[0].read_position()
# ## If restarting, read the last gradient and hessian
# if internal.player.cyc > 1:
# if internal.player.qmprog in ("g03", "g09", "g16"):
# Gaussian.read_forces("grad_hessian.dat")
# Gaussian.read_hessian_fchk("grad_hessian.dat")
## If restarting, read the last gradient and hessian
if internal.player.cyc > 1:
if internal.player.qmprog in ("g03", "g09", "g16"):
Gaussian.read_forces("grad_hessian.dat")
Gaussian.read_hessian_fchk("grad_hessian.dat")
# #if player['qmprog'] == "molcas":
# #Molcas.read_forces("grad_hessian.dat")
# #Molcas.read_hessian("grad_hessian.dat")
#if player['qmprog'] == "molcas":
#Molcas.read_forces("grad_hessian.dat")
#Molcas.read_hessian("grad_hessian.dat")
###
### Start the iterative process
###
for cycle in range(internal.player.cyc, internal.player.cyc + internal.player.maxcyc):
internal.outfile.write("\n" + 90 * "-" + "\n")
internal.outfile.write("{} Step # {}\n".format(40 * " ", cycle))
internal.outfile.write(90 * "-" + "\n\n")
internal.outfile.flush()
make_step_dir(cycle)
if internal.player.altsteps == 0 or internal.player.cyc == 1:
internal.dice.randominit = True
else:
internal.dice.randominit = False
####
#### Start the iterative process
#### Start block of parallel simulations
####
# for cycle in range(internal.player.cyc, internal.player.cyc + internal.player.maxcyc):
procs = []
sentinels = []
for proc in range(1, internal.player.nprocs + 1):
# internal.outfile.write("\n" + 90 * "-" + "\n")
# internal.outfile.write("{} Step # {}\n".format(40 * " ", cycle))
# internal.outfile.write(90 * "-" + "\n\n")
p = Process(target=internal.simulation_process, args=(cycle, proc))
p.start()
procs.append(p)
sentinels.append(p.sentinel)
# make_step_dir(cycle)
while procs:
finished = connection.wait(sentinels)
for proc_sentinel in finished:
i = sentinels.index(proc_sentinel)
status = procs[i].exitcode
procs.pop(i)
sentinels.pop(i)
if status != 0:
for p in procs:
p.terminate()
sys.exit(status)
# if internal.player.altsteps == 0 or cycle == 1:
# internal.dice.randominit = True
# else:
# internal.dice.randominit = False
for proc in range(1, internal.player.nprocs + 1):
internal.print_last_config(cycle, proc)
# ####
# #### Start block of parallel simulations
# ####
####
#### End of parallel simulations block
####
# procs = []
# sentinels = []
# for proc in range(1, internal.player.nprocs + 1):
# ## Make ASEC
# internal.outfile.write("\nBuilding the ASEC and vdW meanfields... ")
# asec_charges = internal.populate_asec_vdw(cycle)
# p = Process(target=Dice.simulation_process, args=(cycle, proc, internal.outfile))
# p.start()
# procs.append(p)
# sentinels.append(p.sentinel)
# ## After ASEC is built, compress files bigger than 1MB
# for proc in range(1, internal.player.nprocs + 1):
# path = "step{:02d}".format(cycle) + os.sep + "p{:02d}".format(proc)
# compress_files_1mb(path)
# while procs:
# finished = connection.wait(sentinels)
# for proc_sentinel in finished:
# i = sentinels.index(proc_sentinel)
# status = procs[i].exitcode
# procs.pop(i)
# sentinels.pop(i)
# if status != 0:
# for p in procs:
# p.terminate()
# sys.exit(status)
# for proc in range(1, internal.player.nprocs + 1):
# Dice.print_last_config(cycle, proc)
# ####
# #### End of parallel simulations block
# ####
# ## Make ASEC
# internal.outfile.write("\nBuilding the ASEC and vdW meanfields... ")
# asec_charges = internal.populate_asec_vdw(cycle)
# ## After ASEC is built, compress files bigger than 1MB
# for proc in range(1, internal.player.nprocs + 1):
# path = "step{:02d}".format(cycle) + os.sep + "p{:02d}".format(proc)
# compress_files_1mb(path)
# ####
# #### Start QM calculation
# ####
####
#### Start QM calculation
####
# make_qm_dir(cycle)

View File

@@ -32,7 +32,7 @@
7 1 -5.315819 1.136106 0.744794 0.20528900 0.0300 2.4200
7 1 -3.338131 -2.250367 -1.102310 0.18436700 0.0300 2.4200
7 1 -1.163740 -1.117915 -0.893805 0.16038200 0.0300 2.4200
16
16 PLACEHOLDER
1 6 0.672026 -2.823446 0.002631 -0.11500000 0.0700 3.5500
1 6 2.072026 -2.823446 0.002631 -0.11500000 0.0700 3.5500
1 6 2.768235 -1.617645 0.002633 -0.11500000 0.0700 3.5500

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

85
run.log
View File

@@ -2,10 +2,10 @@
############# Welcome to DICEPLAYER version 1.0 #############
##########################################################################################
Your python version is 3.8.12 (default, Oct 7 2021, 05:40:48)
[GCC 11.1.0]
Your python version is 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]
Program started on Sunday, 24 Oct 2021 at 00:46:13
Program started on Friday, 05 Nov 2021 at 04:36:09
Environment variables:
OMP_STACKSIZE = Not set
@@ -21,9 +21,9 @@ ghosts = no
lps = no
maxcyc = 3
maxstep = 0.3
nprocs = 2
nprocs = 4
opt = no
qmprog = g09
qmprog = g16
readhessian = no
switchcyc = 3
tol_factor = 1.2
@@ -35,9 +35,10 @@ vdwforces = no
combrule = *
dens = 0.75
init = yes
isave = 1000
ljname = phb.pot
ncores = 1
ncores = 3
nmol = 1 100
nstep = 40000 60000 50000
outname = phb
@@ -45,6 +46,7 @@ press = 1.0
progname = dice
temp = 300.0
title = Diceplayer run
upbuf = 360
------------------------------------------------------------------------------------------
GAUSSIAN variables being used in this run:
@@ -53,9 +55,15 @@ title = Diceplayer run
chgmult = 0 1
level = MP2/aug-cc-pVTZ
pop = chelpg
qmprog = g09
qmprog = g16
==========================================================================================
Program dice found at /usr/local/bin/dice
Program g16 found at /usr/local/g16/g16
Program formchk found at /usr/local/g16/formchk
==========================================================================================
Potential parameters from file phb.pot:
------------------------------------------------------------------------------------------
@@ -123,7 +131,7 @@ Lbl AN X Y Z Charge Epsilon Sigma Mass
==========================================================================================
Molecule type 1:
Molecule type 1 - PHENOL:
Center of mass = ( -0.0000 , 0.0000 , 0.0000 )
Moments of inertia = 3.144054E+02 2.801666E+03 3.027366E+03
@@ -149,7 +157,7 @@ Molecule type 1:
Dipole moment = ( 9.8432 , 0.6168 , 0.8120 ) Total = 9.8959 Debye
Molecule type 2:
Molecule type 2 - PLACEHOLDER:
Center of mass = ( 1.6067 , -1.0929 , 0.0026 )
Moments of inertia = 1.205279E+02 2.859254E+02 4.033761E+02
@@ -166,12 +174,65 @@ Molecule type 2:
New values:
Center of mass = ( 0.0000 , -0.0000 , 0.0000 )
Moments of inertia = 1.205279E+02 2.859254E+02 4.033761E+02
Major principal axis = ( 1.000000 , -0.000000 , 0.000000 )
Inter principal axis = ( 0.000000 , 1.000000 , -0.000000 )
Minor principal axis = ( -0.000000 , 0.000000 , 1.000000 )
Major principal axis = ( -1.000000 , 0.000000 , 0.000000 )
Inter principal axis = ( 0.000000 , 1.000000 , 0.000000 )
Minor principal axis = ( 0.000000 , 0.000000 , 1.000000 )
Characteristic lengths = ( 5.67 , 5.13 , 1.51 )
Total mass = 112.20 au
Total charge = -0.0000 e
Dipole moment = ( 1.7575 , 1.5369 , -0.0000 ) Total = 2.3347 Debye
==========================================================================================
Starting the iterative process.
------------------------------------------------------------------------------------------
Step # 1
------------------------------------------------------------------------------------------
Simulation process step01/p01 initiated with pid 7039
Simulation process step01/p02 initiated with pid 7040
Simulation process step01/p03 initiated with pid 7041
Simulation process step01/p04 initiated with pid 7042
p03> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 04:36:09
p03> NPT thermalization initiated on 05 Nov 2021 at 04:42:40
p01> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 04:36:09
p01> NPT thermalization initiated on 05 Nov 2021 at 04:42:40
p04> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 04:36:09
p04> NPT thermalization initiated on 05 Nov 2021 at 04:42:52
p02> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 04:36:09
p02> NPT thermalization initiated on 05 Nov 2021 at 04:42:54
------------------------------------------------------------------------------------------
Step # 2
------------------------------------------------------------------------------------------
Simulation process step02/p01 initiated with pid 7127
Simulation process step02/p02 initiated with pid 7128
Simulation process step02/p03 initiated with pid 7129
Simulation process step02/p04 initiated with pid 7130
p02> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:04:04
p02> NPT thermalization initiated on 05 Nov 2021 at 05:10:41
p01> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:04:04
p01> NPT thermalization initiated on 05 Nov 2021 at 05:10:49
p03> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:04:04
p03> NPT thermalization initiated on 05 Nov 2021 at 05:10:51
p04> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:04:04
p04> NPT thermalization initiated on 05 Nov 2021 at 05:10:57
------------------------------------------------------------------------------------------
Step # 3
------------------------------------------------------------------------------------------
Simulation process step03/p01 initiated with pid 7182
Simulation process step03/p02 initiated with pid 7183
Simulation process step03/p03 initiated with pid 7184
Simulation process step03/p04 initiated with pid 7185
p04> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:32:04
p04> NPT thermalization initiated on 05 Nov 2021 at 05:38:40
p01> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:32:04
p01> NPT thermalization initiated on 05 Nov 2021 at 05:38:46
p03> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:32:04
p03> NPT thermalization initiated on 05 Nov 2021 at 05:38:51
p02> NVT thermalization initiated (from random configuration) on 05 Nov 2021 at 05:32:04
p02> NPT thermalization initiated on 05 Nov 2021 at 05:38:51

View File

@@ -2,10 +2,10 @@
############# Welcome to DICEPLAYER version 1.0 #############
##########################################################################################
Your python version is 3.8.12 (default, Oct 7 2021, 05:40:48)
[GCC 11.1.0]
Your python version is 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]
Program started on Sunday, 24 Oct 2021 at 00:44:02
Program started on Friday, 05 Nov 2021 at 04:35:58
Environment variables:
OMP_STACKSIZE = Not set
@@ -21,9 +21,9 @@ ghosts = no
lps = no
maxcyc = 3
maxstep = 0.3
nprocs = 2
nprocs = 4
opt = no
qmprog = g09
qmprog = g16
readhessian = no
switchcyc = 3
tol_factor = 1.2
@@ -35,9 +35,10 @@ vdwforces = no
combrule = *
dens = 0.75
init = yes
isave = 1000
ljname = phb.pot
ncores = 1
ncores = 3
nmol = 1 100
nstep = 40000 60000 50000
outname = phb
@@ -45,6 +46,7 @@ press = 1.0
progname = dice
temp = 300.0
title = Diceplayer run
upbuf = 360
------------------------------------------------------------------------------------------
GAUSSIAN variables being used in this run:
@@ -53,9 +55,15 @@ title = Diceplayer run
chgmult = 0 1
level = MP2/aug-cc-pVTZ
pop = chelpg
qmprog = g09
qmprog = g16
==========================================================================================
Program dice found at /usr/local/bin/dice
Program g16 found at /usr/local/g16/g16
Program formchk found at /usr/local/g16/formchk
==========================================================================================
Potential parameters from file phb.pot:
------------------------------------------------------------------------------------------
@@ -123,7 +131,7 @@ Lbl AN X Y Z Charge Epsilon Sigma Mass
==========================================================================================
Molecule type 1:
Molecule type 1 - PHENOL:
Center of mass = ( -0.0000 , 0.0000 , 0.0000 )
Moments of inertia = 3.144054E+02 2.801666E+03 3.027366E+03
@@ -138,18 +146,18 @@ Molecule type 1:
Translating and rotating molecule to standard orientation... Done
New values:
Center of mass = ( -0.0000 , 0.0000 , 0.0000 )
Center of mass = ( -0.0000 , -0.0000 , -0.0000 )
Moments of inertia = 3.144054E+02 2.801666E+03 3.027366E+03
Major principal axis = ( 1.000000 , 0.000000 , 0.000000 )
Inter principal axis = ( -0.000000 , 1.000000 , -0.000000 )
Minor principal axis = ( -0.000000 , 0.000000 , 1.000000 )
Minor principal axis = ( 0.000000 , 0.000000 , 1.000000 )
Characteristic lengths = ( 11.97 , 5.27 , 2.99 )
Total mass = 226.28 au
Total charge = -0.0000 e
Dipole moment = ( 9.8432 , 0.6168 , 0.8120 ) Total = 9.8959 Debye
Molecule type 2:
Molecule type 2 - PLACEHOLDER:
Center of mass = ( 1.6067 , -1.0929 , 0.0026 )
Moments of inertia = 1.205279E+02 2.859254E+02 4.033761E+02
@@ -164,14 +172,21 @@ Molecule type 2:
Translating and rotating molecule to standard orientation... Done
New values:
Center of mass = ( 1.6067 , -1.0929 , 0.0026 )
Moments of inertia = 1.561638E+02 6.739391E+02 8.270247E+02
Major principal axis = ( 0.899747 , -0.436411 , 0.000541 )
Inter principal axis = ( 0.436411 , 0.899747 , -0.001219 )
Minor principal axis = ( 0.000045 , 0.001333 , 0.999999 )
Characteristic lengths = ( 5.67 , 5.05 , 1.51 )
Center of mass = ( 0.0000 , -0.0000 , 0.0000 )
Moments of inertia = 1.205279E+02 2.859254E+02 4.033761E+02
Major principal axis = ( -1.000000 , 0.000000 , 0.000000 )
Inter principal axis = ( 0.000000 , 1.000000 , 0.000000 )
Minor principal axis = ( 0.000000 , 0.000000 , 1.000000 )
Characteristic lengths = ( 5.67 , 5.13 , 1.51 )
Total mass = 112.20 au
Total charge = -0.0000 e
Dipole moment = ( 1.8148 , 1.4689 , -0.0016 ) Total = 2.3347 Debye
Dipole moment = ( 1.7575 , 1.5369 , -0.0000 ) Total = 2.3347 Debye
==========================================================================================
Starting the iterative process.
------------------------------------------------------------------------------------------
Step # 1
------------------------------------------------------------------------------------------