Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph: optional branching #3226

Closed
benfitzpatrick opened this issue Jun 22, 2016 · 8 comments · Fixed by #3515
Closed

graph: optional branching #3226

benfitzpatrick opened this issue Jun 22, 2016 · 8 comments · Fixed by #3515
Milestone

Comments

@benfitzpatrick
Copy link
Contributor

Suicide triggers are sometimes very clunky - maybe we could have syntax to denote a part of the graphing that only runs under certain conditions (e.g. a task succeeds) and otherwise removes itself (or is never inserted).

We use round brackets for optional source inclusion in Rose, and they can't be used on the RHS of a graph in cylc, so maybe we can use them here?

[[[P1D]]]
    graph = """
        foo => bar => baz
        bar[-P1D] => foo
        baz => (qux => wibble => wobble)
    """

This could be presented nicely in the graph view with a subgraph.

@benfitzpatrick benfitzpatrick self-assigned this Jun 22, 2016
@oliver-sanders
Copy link
Member

baz => (subgraph => for => success => case | subgraph => for => fail => case)

@hjoliver
Copy link
Member

[meeting]

  • this is nicer than suicide triggers
  • @oliver-sanders suggested a combined syntax for success/fail alternate workflows (now above)
  • it gets even better once we have task spawn on demand (then, no suiciding even required)
  • @benfitzpatrick may add a more complete example (although I think the one above is fine...)

@oliver-sanders
Copy link
Member

Some more thoughts on this matter:

  1. Branching should go further than just the success and fail cases. A branching example I've seen recently involved clock-expired tasks. foo(:succeed => bar, :expired => baz)?
  2. The foo => (success | fail) syntax may have to be developed to handle larger - more complex subgraphs and will probably have to be split over multiple lines (consider parametrised tasks for instance).
  3. We will need to think about how/if branching should work with message triggers. I can see use cases for using messages with branching to handle multiple outcomes/events for a job which might not be a simple as success/fail. e.g. foo(:succeed => bar, :data-incomplete => baz => bar)

@matthewrmshin
Copy link
Contributor

There is also a case to make branching more obvious. For example, we can use a similar logic as a switch block in common programming language, and have our statuses written in label=value pairs:

  • For mutually exclusive statuses, instead of e.g. succeed, fail, expire, we can have final=0, final=1, final=expire. It should then be clear that on final=0 (succeed), the other final=* branch should suicide.
  • Same goes for a task that can branch according to their custom outputs.

@oliver-sanders
Copy link
Member

It is also worth considering how branches would be displayed in gcylc/cylc-graph (transparency/special colour/?).

@kinow kinow transferred this issue from cylc/cylc-flow Mar 10, 2019
@oliver-sanders
Copy link
Member

I think this issue actually belongs in Cylc Flow.

@matthewrmshin matthewrmshin transferred this issue from cylc/cylc-ui Jul 18, 2019
@matthewrmshin matthewrmshin modified the milestones: later, beyond-cylc-8 Jul 18, 2019
@matthewrmshin
Copy link
Contributor

Issue back to cylc/cylc-flow!

@matthewrmshin matthewrmshin changed the title cylc graphing: optional branching graph: optional branching Jul 18, 2019
@kinow
Copy link
Member

kinow commented Jul 18, 2019

Ops, sorry. Thanks for transferring it back :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants