Skip to content

Commit

Permalink
Add logging warnings for improper termination or process id handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaelman committed Aug 30, 2024
1 parent dad8331 commit fed8f14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions electronicparsers/cp2k/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def __init__(self):
'started_at': 'start_time',
'started_on': 'start_host',
'started_by': 'start_user',
'process_id': 'id',
'process_id': 'process_id',
'started_in': 'start_path',
'ended_at': 'end_time',
'ran_on': 'end_host',
Expand Down Expand Up @@ -1481,15 +1481,15 @@ def parse_settings(self):
sec_run.x_cp2k_section_end_information.append(sec_endinformation)
section = sec_startinformation
for key, val in program_settings.items():
if key == 'id':
if key == 'process_id':
if isinstance(val, list):
sec_startinformation.x_cp2k_start_id = val[0]
sec_endinformation.x_cp2k_end_id = val[1]
elif isinstance(val, int):
# logger.warning('Calculation may not have properly terminated: did not encounter end "PROCESS ID".')
self.logger.warning('Calculation may not have properly terminated: did not encounter end "PROCESS ID".')
sec_startinformation.x_cp2k_start_id = val
else:
# logger.warning('Encountered "PROCESS ID" of unexpected format.')
self.logger.warning('Encountered "PROCESS ID" of unexpected format.')
pass
continue
section = (
Expand Down

0 comments on commit fed8f14

Please sign in to comment.