Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

def create_suite(name) : 
    suite = ecflow.Suite(name)
    for i in range(1, 7) :
        fam = suite.add_family("f" + str(i))
        for t in ( "a", "b", "c", "d", "e" ) :
            fam.add_task(t)
    return suite     
 
   
Python variables can be used to generate trigger dependencies.
Imagine that we want to chain the families f1 to f6, so that f2 runs after f1, f3 after f2 and so on.
The following will do the trick:
def create_seqeuntial_suite(name) :
    suite = ecflow.Suite(name)
    for i in range(1, 7) :
        fam = suite.add_family("f" + str(i))
        if i != 1: 
            fam.add_trigger("f" + str(i-1) + " == complete")  # or fam.add_family( "f%d == complete" % (i-1) )
        for t in ( "a", "b", "c", "d", "e" ) :
            fam.add_task(t) 
    return suite
 
    
The following python code shows examples of adding the various attributes to a node tree.
For a detailed explanation please consult the user manual.

...