Site-specific graph definition

hiya,

i have a fairly simple repeating workflow and i want to remove the circled task here because it is irrelevant at my site…

image

this comes from this bit of the graph definition in the flow.cylc

{{EXPT_RESUB}} ! $  = """                                                                                                                             
lfric_atm[-{{EXPT_RESUB}}] => lfric_atm => rose_arch_dump
postproc[-{{EXPT_RESUB}}] => postproc => supermean
supermean[-{{EXPT_RESUB}}] => supermean => housekeeping                         
housekeeping[-{{EXPT_RESUB}}] => housekeeping
                      """

to begin with, all i want to do is to remove the rose_arch_dump task. i know i can simply edit the flow.cylc but i want it in a site file.

at the bottom of the flow.cylc i have…

{% include 'site/'+SITE+'.rc' %}

i tried putting this in my site file but it doesn’t work,

[scheduling]

[[graph]]
         {{EXPT_RESUB}} ! $  = """
                    lfric_atm[-{{EXPT_RESUB}}] => lfric_atm
                    postproc[-{{EXPT_RESUB}}] => postproc => supermean
                    supermean[-{{EXPT_RESUB}}] => supermean => housekeeping
                    housekeeping[-{{EXPT_RESUB}}] => housekeeping
                    """

this does appear in the cylc view -j output but doesn’t seem to be ‘doing anything’, that is, the graph is unchanged.

any tips for how i can do this?

thanks a lot

jonny

Hi @jonnyhtw

That won’t work because in order to be sufficiently flexible to handle complex graphs with (e.g.) bits added by include-files, graph config items are additive. In other words, you can’t subtract part of a graph by adding more to it.

# (A) main flow.cylc
R1 = "foo => bar"
# PLUS include from my-site.cylc:
R1 = "bar => baz"  # adds to the first definition of R1
# RESULT, at my-site:
R1 = "foo => bar => baz"

for your scenario:

# (B) main flow.cylc
R1 = "foo => bar"
# PLUS include from my-site.cylc:
R1 = "foo"  # adds to (not overrides!) the first definition of R1
# RESULT at my-site:
R1 = "foo => bar"

So it needs to be done like A above, not B; i.e., the rose_arch_dump tasks needs to be included at sites that need it.

(Related: Add, subtract, or override semantics for repeated config items · Issue #1363 · cylc/cylc-flow · GitHub - would allow subtraction of graph triggers by redefinition, but that’s not been seen as a priority issue thus far).

1 Like

oohhh ok got it, makes sense. no problem at all for now, just would be nice to get to the stage where this type of thing is in the design stage from the get go, but i totally understand why it often isn’t!

that’s quite an antique GitHub issue there, opened almost 9 years ago! absolutely makes sense why it hasn’t been a priority though of course.

thanks a lot,

jonny