Cylc 8b2 GraphParseError

I am running into a GraphParseError that I don’t understand. If I define my graph as below, everything validates.

[meta]
     title = "Basic cylc suite for batch submit"
[task parameters]
     ldate = 2013040100
[scheduling]
     [[dependencies]]
        R1 = """
        establish_run_dir<ldate> &
        copy_exec_fixed_files<ldate> & copy_fv3_fixed_files<ldate> &
        copy_cpl_fixed_files<ldate> & copy_mom6_fixed_files<ldate> &
        copy_cice6_fixed_files<ldate> & copy_ww3_fixed_files<ldate> &
        copy_post_files<ldate> & copy_ic_files<ldate> =>
        run_model<ldate>
        """

However, if I change the graph so that establish_run_dir has to run and complete before firing the other tasks (which is what I want), I think I would write it as:

 R1 = """
        establish_run_dir<ldate> =>
        copy_exec_fixed_files<ldate> & copy_fv3_fixed_files<ldate> &
        copy_cpl_fixed_files<ldate> & copy_mom6_fixed_files<ldate> &
        copy_cice6_fixed_files<ldate> & copy_ww3_fixed_files<ldate> &
        copy_post_files<ldate> & copy_ic_files<ldate> =>
        run_model<ldate>
        """

But this gives me the following error:

GraphParseError: null task name in graph:
  establish_run_dir_ldate2013040100 => 
copy_exec_fixed_files_ldate2013040100&copy_fv3_fixed_files_ldate2013040100&

I’ve done the sensitivity test so I know it is just changing that first & to => that triggers the error, but it seems like this is something I should be able to. As always, any help will be appreciated!

Hi @bencash,

The problem is we only support splitting of graph dependency chains on the dependency arrow =>.

We probably should allow splitting on & and | operators too, for those using crazy-long task names :grin: - I’ll post an issue on GitHub to consider that.

The quick and ugly workarounds:

  • use very long lines and turn on line-wrapping in your code editor for Cylc
  • OR use old-school line continuation characters (with no space allowed after them!):
R1 = """
   a => b & c & \
      d & e & \
         f & g
"""

Line continuation characters did the trick. :slight_smile: And if I don’t use crazy long task names tomorrow I will be staring at this suite wondering what the :face_with_symbols_over_mouth: I was doing… :wink:

2 Likes

@bencash - as an alternative to line continuation characters, I’ve been using family triggering for this type of thing.
Bit more boilerplate, but:

  • less prone to horrible-to-debug issues from stray whitespaces after any line continuation chars!
  • IMO makes the graph much more readable for intent (if you have a sensibly-named family trigger!)
    • You can help the reader with metadata in the family trigger
    • I’ve come up with ~baroque “naming conventions” for myself on families with different functions, e.g. using _TRG suffixes on families used for triggering; mostly to help myself think clearly / cleanly separate purpose
  • to help me work out which tasks XYZ_TRG actually comprises/triggers, without needing to hunt for tasks it’s inherited in, I’ve found the cylc graph --namespaces command super-helpful (see bottom of family triggering tutorial above)
R1 = """
a => MYGROUP_TRG
"""
[runtime]
[[MYGROUP_TRG]]
   [[[meta]]]
       title = Trigger for mygroup tasks
       description = Trigger family used to handle graphing logic for tasks related to mygroup
[[b]]
    inherit = FOO, BAR, MYGROUP_TRG
[[c]]
    inherit = BAZ, QUX, MYGROUP_TRG
# etc
1 Like

(A small update to this topic: upcoming Cylc 8 releases will feature graph line continuation on & and | as well as =>)

2 Likes