Cylc8b1 dependent jobs not waiting for completion?

I’m trying to set up a basic cycled workflow where a chain of jobs is exectuted one task after another in a chain:

run_cesm=>run_post=>run_ml=>update_case=>run_cesm=>[repeat]. I have tried to set this up using integer cycling to run twice, with run_cesm replaced by sleep 600 to create a delay. But what is happening is the workflow is just running straight through, so I end up with two copies of run_cesm running simultaneously. Presumably this is because I have screwed up my flow.cylc - if someone can tell me how to do this correctly I will be grateful. :slight_smile:

 #!jinja2
 {% set ncycles = 2 %}
 
 [meta]
     title = "flow.cylc for MITC test run"
 
 [scheduling]
      cycling mode=integer
      initial cycle point =1
      final cycle point={{ncycles}}
      [[graph]]
          R/^/P1 = """
             run_cesm=>run_post
             run_post[-P1]=>run_ml
             run_ml[-P1]=>update_case
             update_case[-P1]=>run_cesm
             run_cesm[-P1]=>run_post
              """
 [runtime]
     [[root]]
 #        platform = cheyenne
     [[run_cesm]]
         platform = cheyenne
         execution time limit = PT12H
 #        script = cd /glade/work/bcash/ssf/my_cesm_sandbox/cime/scripts/MITC_base; /glade/work/bcash/ssf/my_cesm_sandbox/cime/scripts/MITC_base/cylc.case.run
         script = sleep 600
         [[[directives]]]
             -N=MITC_base.run
             -r=n
             -j=oe
             -S=/bin/bash
             -l=select=1:ncpus=36:mpiprocs=36:ompthreads=1
             -A=UMIN0005
             -m=abe
             -M=bcash@gmu.edu
             -q=regular
 
     [[run_post]]
         script = echo "run_post placeholder"
     [[run_ml]]
         script = echo "run_ml placeholder"
     [[update_case]]
         script = echo "update_case placeholder"

The inter-cycle dependencies are a little bit off, here’s a graphical representation:

dotfile

Here’s an example which I think is closer to what you want:

[scheduler]
    allow implicit tasks = True

[scheduling]
    initial cycle point = 1
    cycling mode = integer
    [[graph]]
        P1 = """
            # the repeating unit
            run_cesm => run_post => run_ml => update_case
            # the cycling rules that constrain the parallelism
            update_case[-P1] => run_cesm
        """

At the moment Cylc8 does not have the ability to generate these graphs for you (will arrive in the new Cylc GUI in the future), in the mean time I generated these graphs using the following bash script:

#!/usr/bin/env bash

set -eu

SUITE="$1"
FMT="$2"

TMP=dotfile

cylc graph --color=never --reference "$SUITE" > "$TMP.ref"

sed \
    -e 's/node "\(.*\)" "\(.*\)"/"\1" [label="\2"]/' \
    -e 's/edge "\(.*\)" "\(.*\)"/"\1" -> "\2"/' \
    -e '1i digraph {' \
    -e '$a}' \
    -e '/^graph$/d' \
    -e '/^stop$/d' \
    "$TMP.ref" \
    > "$TMP.dot"

dot \
    "$TMP.dot" \
    -T"$FMT" \
    -o "$TMP.$FMT"

rm "$TMP.ref" "$TMP.dot"

echo "written to $TMP.$FMT"
1 Like

That did it, thanks!