Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
scheduler, task_pool, task_proxy refactor
Browse files Browse the repository at this point in the history
Move logic after merging cylc#2213.
  • Loading branch information
matthewrmshin committed Apr 6, 2017
1 parent 3963d82 commit 438e41e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 1 addition & 7 deletions lib/cylc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,13 +989,7 @@ def configure_suite(self, reconfigure=False):
self.suite_state = StateSummaryServer.get_inst(self.run_mode)
self.comms_daemon.connect(self.suite_state, COMMS_STATE_OBJ_NAME)

for namespace in self.config.cfg['runtime']:
ancestors = (' ').join(
self.config.runtime['linearized ancestors'][namespace])
self.pri_dao.add_insert_item(CylcSuiteDAO.TABLE_INHERITANCE,
[namespace, ancestors])
self.pub_dao.add_insert_item(CylcSuiteDAO.TABLE_INHERITANCE,
[namespace, ancestors])
self.suite_db_mgr.put_runtime_inheritance(self.config)

def configure_suite_environment(self):
"""Configure suite environment."""
Expand Down
10 changes: 10 additions & 0 deletions lib/cylc/suite_db_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class SuiteDatabaseManager(object):
"""Manage the suite runtime private and public databases."""

TABLE_CHECKPOINT_ID = CylcSuiteDAO.TABLE_CHECKPOINT_ID
TABLE_INHERITANCE = CylcSuiteDAO.TABLE_INHERITANCE
TABLE_SUITE_PARAMS = CylcSuiteDAO.TABLE_SUITE_PARAMS
TABLE_SUITE_TEMPLATE_VARS = CylcSuiteDAO.TABLE_SUITE_TEMPLATE_VARS
TABLE_TASK_ACTION_TIMERS = CylcSuiteDAO.TABLE_TASK_ACTION_TIMERS
Expand All @@ -54,6 +55,7 @@ def __init__(self, pri_d=None, pub_d=None):
self.TABLE_TASK_POOL: [],
self.TABLE_TASK_ACTION_TIMERS: []}
self.db_inserts_map = {
self.TABLE_INHERITANCE: [],
self.TABLE_SUITE_PARAMS: [],
self.TABLE_SUITE_TEMPLATE_VARS: [],
self.TABLE_CHECKPOINT_ID: [],
Expand Down Expand Up @@ -174,6 +176,14 @@ def process_queued_ops(self):
self.pri_dao.execute_queued_items()
self.pub_dao.execute_queued_items()

def put_runtime_inheritance(self, config):
"""Put task/family inheritance in runtime database."""
for namespace in config.cfg['runtime']:
value = ' '.join(config.runtime['linearized ancestors'][namespace])
self.db_inserts_map[self.TABLE_INHERITANCE].append({
"namespace": namespace,
"inheritance": value})

def put_suite_params(
self, run_mode, initial_point, final_point, is_held,
cycle_point_format=None):
Expand Down

0 comments on commit 438e41e

Please sign in to comment.