Skip to content

Commit

Permalink
Fix job submit delta.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Dec 9, 2021
1 parent b228798 commit 51492d0
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions cylc/flow/task_events_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,20 +1030,22 @@ def _process_message_submitted(self, itask, event_time, submit_num):
f"[{summary['submit_method_id']}]"
)

# Register the newly submitted job with the database and datastore.
self._insert_task_job(itask, event_time, self.JOB_SUBMIT_SUCCESS_FLAG)
job_d = get_task_job_id(
itask.point, itask.tdef.name, itask.submit_num)

itask.set_summary_time('submitted', event_time)
self.data_store_mgr.delta_job_time(job_d, 'submitted', event_time)
if itask.tdef.run_mode == 'simulation':
# Simulate job execution at this point.
itask.set_summary_time('submitted', event_time)
# Simulate job started as well.
itask.set_summary_time('started', event_time)
self.data_store_mgr.delta_job_time(job_d, 'started', event_time)
if itask.state_reset(TASK_STATUS_RUNNING):
self.data_store_mgr.delta_task_state(itask)
itask.state.outputs.set_completion(TASK_OUTPUT_STARTED, True)
self.data_store_mgr.delta_task_output(itask, TASK_OUTPUT_STARTED)

else:
itask.set_summary_time('submitted', event_time)
job_d = get_task_job_id(
itask.point, itask.tdef.name, itask.submit_num)
self.data_store_mgr.delta_job_time(job_d, 'submitted', event_time)
self.data_store_mgr.delta_job_state(job_d, TASK_STATUS_SUBMITTED)
# Unset started and finished times in case of resubmission.
itask.set_summary_time('started')
Expand All @@ -1065,9 +1067,6 @@ def _process_message_submitted(self, itask, event_time, submit_num):
self.data_store_mgr.delta_task_queued(itask)
self._reset_job_timers(itask)

# Register the newly submitted job with the database and datastore.
self._insert_task_job(itask, event_time, self.JOB_SUBMIT_SUCCESS_FLAG)

def _insert_task_job(
self,
itask: 'TaskProxy',
Expand Down

0 comments on commit 51492d0

Please sign in to comment.