#!Jinja2
[scheduling]
    [[ queues ]]
        [[[ q_fam ]]]
            limit = {{q_size}} # allow testing with various queue sizes
            members = monitor, FAM
    [[graph]]
        R1 = monitor:start => FAM
[runtime]
    [[FAM]]
        script = true
    [[a,b,c,d,e,f,g,h,i,j,k,l]]
        inherit = FAM
    [[monitor]]
        script = """
        N_SUCCEEDED=0
        while ((N_SUCCEEDED < 12)); do
            sleep 1
            N_RUNNING=$(cylc dump -l -t $CYLC_WORKFLOW_ID | grep running | wc -l)
            ((N_RUNNING <= {{q_size}})) # check
            N_SUCCEEDED=$(cylc workflow-state "${CYLC_WORKFLOW_ID}//*/*:succeeded" | wc -l)
        done
"""
