Skip to content

Commit

Permalink
Merge pull request #4243 from jtkrogel/nx_pyscf_qmc_fix
Browse files Browse the repository at this point in the history
Nexus: fix convert4qmc hdf5 issue
  • Loading branch information
prckent authored Sep 20, 2022
2 parents e6d0f8e + e1456db commit 500dcc3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nexus/lib/qmcpack_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,25 @@ def check_sim_status(self):
output = open(os.path.join(self.locdir,self.outfile),'r').read()
#errors = open(os.path.join(self.locdir,self.errfile),'r').read()

# Recent versions of convert4qmc no longer produce the orbs.h5 file.
# Instead, the file produced directly by e.g. Pyscf is used instead.
# Therefore, make a symlink to the previously produced file in
# place of the orbs.h5 file.
orbs = self.input.orbitals
finished = self.job.finished
h5_orbs = orbs is not None and orbs.endswith('.h5')
if finished and h5_orbs:
orbfile = self.get_prefix()+'.orbs.h5'
orbfilepath = os.path.join(self.locdir,orbfile)
h5_orbs_missing = not os.path.exists(orbfilepath)
if h5_orbs_missing:
cwd = os.getcwd()
os.chdir(self.locdir)
os.system('ln -s {} {}'.format(orbs,orbfile))
os.chdir(cwd)
#end if
#end if

success = 'QMCGaussianParserBase::dump' in output
for filename in self.list_output_files():
success &= os.path.exists(os.path.join(self.locdir,filename))
Expand Down

0 comments on commit 500dcc3

Please sign in to comment.