Commit 1c4d7183 authored by Ask Hjorth Larsen's avatar Ask Hjorth Larsen
Browse files

with octopus metainfo now included in the 'all'-file, enable octopus-specific metadata

parent 4cfdba76
......@@ -90,8 +90,8 @@ def parse_infofile(meta_info_env, pew, fname):
for line in fd:
if line.startswith('SCF converged'):
iterations = int(line.split()[-2])
#pew.addValue('x_octopus_info_scf_converged_iterations',
# iterations)
pew.addValue('x_octopus_info_scf_converged_iterations',
iterations)
break
for line in fd: # Jump down to energies:
if line.startswith('Energy ['):
......@@ -101,7 +101,7 @@ def parse_infofile(meta_info_env, pew, fname):
names = {'Total': 'energy_total',
'Free': 'energy_free',
#'Ion-ion': 'x_octopus_info_energy_ion_ion',
'Ion-ion': 'x_octopus_info_energy_ion_ion',
'Eigenvalues': 'energy_sum_eigenvalues',
'Hartree': 'energy_electrostatic',
'Exchange': 'energy_X',
......
......@@ -19,7 +19,7 @@ logFileDescription = SM(
subFlags=SM.SubFlags.Sequenced,
subMatchers=[
SM(r'Version\s*:\s*%s' % word('program_version')),
SM(r'Revision\s*:\s*%s' % integer('x_octopus_log_svn_revision')),
#SM(r'Revision\s*:\s*%s' % integer('x_octopus_log_svn_revision')),
]
)
......@@ -39,9 +39,8 @@ def parse_logfile(meta_info_env, pew, fname):
version = line.split()[-1]
pew.addValue('program_version', version)
elif line.startswith('Revision'):
revision = line.split()[-1]
#pew.addValue('x_octopus_log_svn_revision', revision)
# WTF
revision = int(line.split()[-1])
pew.addValue('x_octopus_log_svn_revision', revision)
# XXX more info
......
......@@ -211,6 +211,7 @@ def register_octopus_keywords(pew, category, kwargs):
def parse(fname, fd):
# fname refers to the static/info file.
# Look for files before we create some of our own files for logging etc.:
staticdirname, _basefname = os.path.split(fname)
dirname, _static = os.path.split(staticdirname)
......@@ -218,10 +219,8 @@ def parse(fname, fd):
parser_log_path = os.path.join(dirname, 'exec', 'parser.log')
logfile = find_octopus_logfile(dirname)
# fname refers to the static/info file.
pew = JsonParseEventsWriterBackend(metaInfoEnv)
pew.startedParsingSession(fname, parser_info)
#fileOut=open('json-writer.log', 'w'))
# this context manager shamelessly copied from GPAW parser
# Where should Python code be put if it is used by multiple parsers?
......@@ -238,13 +237,12 @@ def parse(fname, fd):
print('Read Octopus keywords from input file %s' % inp_path,
file=fd)
kwargs = read_input_file(inp_path)
#with open_section('x_octopus_input'):
# register_octopus_keywords(pew, 'input', kwargs)
register_octopus_keywords(pew, 'input', kwargs)
print('Read processed Octopus keywords from octparse logfile %s'
% parser_log_path, file=fd)
parser_log_kwargs = read_parser_log(parser_log_path)
#register_octopus_keywords(pew, 'parserlog', parser_log_kwargs)
register_octopus_keywords(pew, 'parserlog', parser_log_kwargs)
print('Override certain keywords with processed keywords', file=fd)
kwargs = override_keywords(kwargs, parser_log_kwargs, fd)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment