diff --git a/cylc/flow/etc/syntax/cylc.lang b/cylc/flow/etc/syntax/cylc.lang index c3f43da2c95..6179a18f750 100644 --- a/cylc/flow/etc/syntax/cylc.lang +++ b/cylc/flow/etc/syntax/cylc.lang @@ -93,7 +93,6 @@ work sub-directory warning handlers verbose mode - user to title time limit buffer @@ -116,15 +115,17 @@ stall handlers speedup factor special tasks + skip simulation shutdown handlers + sequential xtriggers sequential script scheduling scheduler runtime runahead limit - run-dir + run mode retry handlers retrieve job logs retry delays retrieve job logs max size @@ -198,10 +199,12 @@ cycle point format custom handlers critical handlers + completion clock-trigger clock-expire batch system batch submit command template + alt-cylc-run-dir allow implicit tasks abort on workflow timeout abort on stall timeout diff --git a/cylc/flow/etc/syntax/cylc.xml b/cylc/flow/etc/syntax/cylc.xml index da11c1215e1..be74c2fa4ad 100644 --- a/cylc/flow/etc/syntax/cylc.xml +++ b/cylc/flow/etc/syntax/cylc.xml @@ -20,7 +20,6 @@ - @@ -43,15 +42,17 @@ + + - + @@ -125,10 +126,12 @@ + + diff --git a/cylc/flow/run_modes/skip.py b/cylc/flow/run_modes/skip.py index 8347c71e3dc..9a05aa4729b 100644 --- a/cylc/flow/run_modes/skip.py +++ b/cylc/flow/run_modes/skip.py @@ -68,11 +68,12 @@ def submit_task_job( 'try_num': itask.get_try_num(), 'flow_nums': str(list(itask.flow_nums)), 'is_manual_submit': itask.is_manual_submit, - 'job_runner_name': RunMode.SIMULATION.value, - 'platform_name': RunMode.SIMULATION.value, + 'job_runner_name': RunMode.SKIP.value, + 'platform_name': RunMode.SKIP.value, 'submit_status': 0 # Submission has succeeded } ) + task_job_mgr.workflow_db_mgr.put_update_task_state(itask) for output in process_outputs(itask, rtconfig): task_job_mgr.task_events_mgr.process_message(itask, INFO, output) diff --git a/cylc/flow/task_job_mgr.py b/cylc/flow/task_job_mgr.py index 036aa881980..2435d7e4197 100644 --- a/cylc/flow/task_job_mgr.py +++ b/cylc/flow/task_job_mgr.py @@ -465,6 +465,7 @@ def submit_livelike_task_jobs( 'platform_name': itask.platform['name'], 'job_runner_name': itask.summary['job_runner_name'], }) + itask.is_manual_submit = False if ri_map[install_target] == REMOTE_FILE_INSTALL_255: @@ -1080,6 +1081,10 @@ def submit_nonlive_task_jobs( self, itask, rtconfig, workflow, now) if nonlive_mode: + self.workflow_db_mgr.put_insert_task_states( + itask, { + 'submit_num': itask.submit_num, + 'flow_nums': serialise_set(itask.flow_nums)}) nonlive_tasks.append(itask) else: lively_tasks.append(itask) diff --git a/tests/integration/run_modes/test_nonlive.py b/tests/integration/run_modes/test_nonlive.py index 973f39e3301..82222b53824 100644 --- a/tests/integration/run_modes/test_nonlive.py +++ b/tests/integration/run_modes/test_nonlive.py @@ -36,7 +36,7 @@ 'run_signal': None, 'run_status': 0, 'platform_name': 'skip', - 'job_runner_name': 'simulation', + 'job_runner_name': 'skip', 'job_id': None}, } @@ -47,7 +47,7 @@ def not_time(data: Dict[str, Any]): return {k: v for k, v in data.items() if 'time' not in k} -async def test_task_jobs(flow, scheduler, start, capture_live_submissions): +async def test_db_task_jobs(flow, scheduler, start, capture_live_submissions): """Ensure that task job data is added to the database correctly for each run mode. """ @@ -94,6 +94,28 @@ async def test_task_jobs(flow, scheduler, start, capture_live_submissions): assert task_proxies[1].run_mode == 'skip' +async def test_db_task_states( + one_conf, flow, scheduler, start +): + """Test that tasks will have the same information entered into the task + state database whichever mode is used. + """ + conf = one_conf + conf['runtime'] = {'one': {'run mode': 'skip'}} + schd = scheduler(flow(conf)) + async with start(schd): + schd.task_job_mgr.submit_task_jobs( + schd.workflow, + schd.pool.get_tasks(), + schd.server.curve_auth, + schd.server.client_pub_key_dir + ) + schd.workflow_db_mgr.process_queued_ops() + result = schd.workflow_db_mgr.pri_dao.connect().execute( + 'SELECT * FROM task_states').fetchone() + assert result[5] == 1 + + async def test_mean_task_time( flow, scheduler, start, complete, capture_live_submissions ):