From a93eb57ec05e87b02faad084df148571d45822b6 Mon Sep 17 00:00:00 2001 From: Ben Fitzpatrick Date: Mon, 18 Aug 2014 12:22:22 +0100 Subject: [PATCH 1/2] #1008: fix start-up graphing in simplest case --- lib/cylc/config.py | 13 +++++++-- tests/cyclers/29-back_comp_start_up_simple.t | 1 + .../back_comp_start_up_simple/graph.plain.ref | 7 +++++ .../back_comp_start_up_simple/reference.log | 29 +++++++++++++++++++ .../back_comp_start_up_simple/suite.rc | 11 +++++++ 5 files changed, 58 insertions(+), 3 deletions(-) create mode 120000 tests/cyclers/29-back_comp_start_up_simple.t create mode 100644 tests/cyclers/back_comp_start_up_simple/graph.plain.ref create mode 100644 tests/cyclers/back_comp_start_up_simple/reference.log create mode 100644 tests/cyclers/back_comp_start_up_simple/suite.rc diff --git a/lib/cylc/config.py b/lib/cylc/config.py index f2f3fcad01a..d424fedefc2 100644 --- a/lib/cylc/config.py +++ b/lib/cylc/config.py @@ -1254,8 +1254,14 @@ def process_graph_line( self, line, section, ttype, seq, offset_seq_map, if not self.validation and not graphing_disabled: # edges not needed for validation - self.generate_edges( lexpression, pruned_left_nodes, - right_name, ttype, + left_edge_nodes = pruned_left_nodes + right_edge_node = right_name + if not left_edge_nodes and left_nodes: + # All the left nodes have been pruned. + left_edge_nodes = [right_name] + right_edge_node = None + self.generate_edges( lexpression, left_edge_nodes, + right_edge_node, ttype, seq, suicide ) self.generate_taskdefs( orig_line, pruned_left_nodes, right_name, ttype, @@ -1516,6 +1522,7 @@ def get_graph_raw( self, start_point_string, stop_point_string, raw=False, for e in self.edges: # Get initial cycle point for this sequence i_point = e.sequence.get_first_point( start_point ) + if i_point is None: # out of bounds continue @@ -1527,7 +1534,7 @@ def get_graph_raw( self, start_point_string, stop_point_string, raw=False, break not_initial_cycle = ( point != i_point ) - + r_id = e.get_right(point, start_point, not_initial_cycle, raw, startup_exclude_list ) l_id = e.get_left( point, start_point, not_initial_cycle, raw, diff --git a/tests/cyclers/29-back_comp_start_up_simple.t b/tests/cyclers/29-back_comp_start_up_simple.t new file mode 120000 index 00000000000..6b344bc8bb5 --- /dev/null +++ b/tests/cyclers/29-back_comp_start_up_simple.t @@ -0,0 +1 @@ +00-daily.t \ No newline at end of file diff --git a/tests/cyclers/back_comp_start_up_simple/graph.plain.ref b/tests/cyclers/back_comp_start_up_simple/graph.plain.ref new file mode 100644 index 00000000000..2415c2485c7 --- /dev/null +++ b/tests/cyclers/back_comp_start_up_simple/graph.plain.ref @@ -0,0 +1,7 @@ +edge "cold_foo.2014090100" "foo.2014090100" solid black +graph +node "cold_foo.2014090100" "cold_foo\n2014090100" unfilled box black lightgrey +node "foo.2014090100" "foo\n2014090100" unfilled box black lightgrey +node "foo.2014090106" "foo\n2014090106" unfilled box black lightgrey +node "foo.2014090112" "foo\n2014090112" unfilled box black lightgrey +stop diff --git a/tests/cyclers/back_comp_start_up_simple/reference.log b/tests/cyclers/back_comp_start_up_simple/reference.log new file mode 100644 index 00000000000..428afb3ec3b --- /dev/null +++ b/tests/cyclers/back_comp_start_up_simple/reference.log @@ -0,0 +1,29 @@ +2014-08-18T12:19:43+01 INFO - port:7766 +2014-08-18T12:19:43+01 INFO - Suite starting at 2014-08-18T12:19:43+01 +2014-08-18T12:19:43+01 INFO - Log event clock: real time +2014-08-18T12:19:43+01 INFO - Run mode: live +2014-08-18T12:19:43+01 INFO - Initial point: 2014090100 +2014-08-18T12:19:43+01 INFO - Final point: 2014090112 +2014-08-18T12:19:43+01 INFO - Cold Start 2014090100 +2014-08-18T12:19:43+01 INFO - [cold_foo.2014090100] -triggered off [] +2014-08-18T12:19:44+01 INFO - [cold_foo.2014090100] -submit_method_id=7693 +2014-08-18T12:19:44+01 INFO - [cold_foo.2014090100] -submission succeeded +2014-08-18T12:19:44+01 INFO - [cold_foo.2014090100] -(current:submitted)> cold_foo.2014090100 started at 2014-08-18T12:19:43+01 +2014-08-18T12:19:51+01 INFO - [cold_foo.2014090100] -(current:running)> cold_foo.2014090100 succeeded at 2014-08-18T12:19:50+01 +2014-08-18T12:19:52+01 INFO - [foo.2014090100] -triggered off ['cold_foo.2014090100'] +2014-08-18T12:19:53+01 INFO - [foo.2014090100] -submit_method_id=7808 +2014-08-18T12:19:53+01 INFO - [foo.2014090100] -submission succeeded +2014-08-18T12:19:53+01 INFO - [foo.2014090100] -(current:submitted)> foo.2014090100 started at 2014-08-18T12:19:52+01 +2014-08-18T12:19:54+01 INFO - [foo.2014090106] -triggered off [] +2014-08-18T12:19:55+01 INFO - [foo.2014090106] -submit_method_id=7910 +2014-08-18T12:19:55+01 INFO - [foo.2014090106] -submission succeeded +2014-08-18T12:19:55+01 INFO - [foo.2014090106] -(current:submitted)> foo.2014090106 started at 2014-08-18T12:19:55+01 +2014-08-18T12:19:56+01 INFO - [foo.2014090112] -triggered off [] +2014-08-18T12:19:57+01 INFO - [foo.2014090112] -submit_method_id=8015 +2014-08-18T12:19:57+01 INFO - [foo.2014090112] -submission succeeded +2014-08-18T12:19:57+01 INFO - [foo.2014090118] -holding (beyond suite stop point) 2014090112 +2014-08-18T12:19:57+01 INFO - [foo.2014090112] -(current:submitted)> foo.2014090112 started at 2014-08-18T12:19:57+01 +2014-08-18T12:19:58+01 INFO - [foo.2014090100] -(current:running)> foo.2014090100 succeeded at 2014-08-18T12:19:57+01 +2014-08-18T12:20:04+01 INFO - [foo.2014090112] -(current:running)> foo.2014090112 succeeded at 2014-08-18T12:20:03+01 +2014-08-18T12:20:09+01 INFO - [foo.2014090106] -(current:running)> foo.2014090106 succeeded at 2014-08-18T12:20:09+01 +2014-08-18T12:20:10+01 INFO - Suite shutting down at 2014-08-18T12:20:10+01 diff --git a/tests/cyclers/back_comp_start_up_simple/suite.rc b/tests/cyclers/back_comp_start_up_simple/suite.rc new file mode 100644 index 00000000000..ed2ee99b5e0 --- /dev/null +++ b/tests/cyclers/back_comp_start_up_simple/suite.rc @@ -0,0 +1,11 @@ +[scheduling] + initial cycle time = 2014090100 + final cycle time = 2014090112 + [[special tasks]] + start-up = cold_foo + [[dependencies]] + [[[0,6,12,18]]] + graph = cold_foo => foo +[visualization] + initial cycle time = 2014090100 + final cycle time = 2014090112 From 1382e94384aacc42cb197d2484599561a6a95620 Mon Sep 17 00:00:00 2001 From: Ben Fitzpatrick Date: Mon, 18 Aug 2014 12:23:24 +0100 Subject: [PATCH 2/2] remove whitespace --- lib/cylc/config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/cylc/config.py b/lib/cylc/config.py index d424fedefc2..6004bcdaea9 100644 --- a/lib/cylc/config.py +++ b/lib/cylc/config.py @@ -1522,7 +1522,6 @@ def get_graph_raw( self, start_point_string, stop_point_string, raw=False, for e in self.edges: # Get initial cycle point for this sequence i_point = e.sequence.get_first_point( start_point ) - if i_point is None: # out of bounds continue @@ -1534,7 +1533,7 @@ def get_graph_raw( self, start_point_string, stop_point_string, raw=False, break not_initial_cycle = ( point != i_point ) - + r_id = e.get_right(point, start_point, not_initial_cycle, raw, startup_exclude_list ) l_id = e.get_left( point, start_point, not_initial_cycle, raw,