ecFlow's documentation is now on readthedocs!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Tasks can be logically grouped into family‘s.
You can picture a suite as a hierarchical structure very similar to a unix
file system, where the families are the directories and the tasks are the files.
The suite is a family with some extra attributes (See Dates and Clocks).
Like directories, families can themselves contain other families.
And like directories, different families can contain tasks with similar names
# Definition of the suite test.
suite test
   edit ECF_INCLUDE "$HOME/course"
   edit ECF_HOME    "$HOME/course"
   family f1
      task t1
      task t2
   endfamily
endsuite

If you are using the ecFlow Python Api:

#!/usr/bin/env python2.5
import os
import ecflow 
   
def create_family_f1():
    f1 = ecflow.Family("f1")
    f1.add_task("t1")
    f1.add_task("t2")
    return f1
      
defs = ecflow.Defs()
suite = defs.add_suite("test")
suite.add_variable("ECF_INCLUDE",os.getenv("HOME") + "/course")
suite.add_variable("ECF_HOME   ",os.getenv("HOME") + "/course")

suite.add_family( create_family_f1() )
Unless you tell ecFlow where to find specific files, the default behaviour
is to expect the file structure to reflect the structure of the suite.
In this case you will have to create a directory $HOME/course/test/f1,
and move t1.ecf and t2.ecf into it.
Conversely, the ecFlow jobs and the outputs will be created in this directory.
Because we have moved the scripts in another directory, ecFlow will not find
the two included file head.h and tail.h one directory up from
the scripts.
We could modify the scripts to search the include file two directories up,
but this would be very cumbersome.
The solution is to define a special ecFlow variable called ECF_INCLUDE
that points to the directory containing the include files.
We need to do the following changes to the ecf script‘s.

from:

%include "../head.h"
echo "I am part of a suite that lives in %ECF_HOME%"
%include "../tail.h"

to:

%include <head.h>
echo "I am part of a suite that lives in %ECF_HOME%"
%include <tail.h>
suite‘s, family‘s and task‘s are called node‘s.
Because of this analogy with the unix file system, nodes can be addressed
using full names: /test/f1/t1 refers to the task t1, and
/test/f1 refers to the family f1.
In some contexts, ecFlow will accept relative names, such as ../t1.

The hierarchy is shown as a tree in ecflowview.

What to do:

  1. Write the suite definition
  2. Create the directories needed, move the ecf script‘s
  3. Edit the script to include head.h and tail.h from the ECF_INCLUDE directory.
  4. Load and begin the suite again
  5. View the suite in ecflowview, notice the tree structure. You may have to unfold test and f1 to see the tasks, using the middle mouse button.
  • No labels