<div id="families"> <span id="index-0"></span><span id="id1"></span> <div > <div >Tasks can be logically grouped into <a href="/wiki/display/ECFLOW/Glossary#term-family"><em >family</em></a>‘s.</div> <div >You can picture a suite as a hierarchical structure very similar to a unix</div> <div >file system, where the families are the directories and the tasks are the files.</div> <div >The suite is a family with some extra attributes (See <a href="/wiki/display/ECFLOW/Dates+and+Clocks#dates-and-clocks"><em>Dates and Clocks</em></a>).</div> <div >Like directories, families can themselves contain other families.</div> <div >And like directories, different families can contain tasks with similar names</div> </div> <div ><pre># 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</pre> </div> <p>If you are using the <a href="/wiki/display/ECFLOW/ecFlow+Python+Api#python-api"><em>ecFlow Python Api</em></a>:</p> <div ><div ><pre><span >#!/usr/bin/env python2.5</span> <span >import</span> <span >os</span> <span >import</span> <span >ecflow</span> <span >def</span> <span >create_family_f1</span><span >():</span> <span >f1</span> <span >=</span> <span >ecflow</span><span >.</span><span >Family</span><span >(</span><span >"f1"</span><span >)</span> <span >f1</span><span >.</span><span >add_task</span><span >(</span><span >"t1"</span><span >)</span> <span >f1</span><span >.</span><span >add_task</span><span >(</span><span >"t2"</span><span >)</span> <span >return</span> <span >f1</span> <span >defs</span> <span >=</span> <span >ecflow</span><span >.</span><span >Defs</span><span >()</span> <span >suite</span> <span >=</span> <span >defs</span><span >.</span><span >add_suite</span><span >(</span><span >"test"</span><span >)</span> <span >suite</span><span >.</span><span >add_variable</span><span >(</span><span >"ECF_INCLUDE"</span><span >,</span><span >os</span><span >.</span><span >getenv</span><span >(</span><span >"HOME"</span><span >)</span> <span >+</span> <span >"/course"</span><span >)</span> <span >suite</span><span >.</span><span >add_variable</span><span >(</span><span >"ECF_HOME "</span><span >,</span><span >os</span><span >.</span><span >getenv</span><span >(</span><span >"HOME"</span><span >)</span> <span >+</span> <span >"/course"</span><span >)</span> <span >suite</span><span >.</span><span >add_family</span><span >(</span> <span >create_family_f1</span><span >()</span> <span >)</span> </pre></div> </div> <div > <div >Unless you tell ecFlow where to find specific files, the default behaviour</div> <div >is to expect the file structure to reflect the structure of the suite.</div> <div >In this case you will have to create a directory <tt ><span >$HOME/course/test/f1</span></tt>,</div> <div >and move <tt ><span >t1.ecf</span></tt> and <tt ><span >t2.ecf</span></tt> into it.</div> <div >Conversely, the ecFlow jobs and the outputs will be created in this directory.</div> </div> <div > <div >Because we have moved the scripts in another directory, ecFlow will not find</div> <div >the two included file <a href="/wiki/display/ECFLOW/Understanding+Includes#head-h"><em>head.h</em></a> and <a href="/wiki/display/ECFLOW/Understanding+Includes#tail-h"><em>tail.h</em></a> one directory up from</div> <div >the scripts.</div> </div> <div > <div >We could modify the scripts to search the include file two directories up,</div> <div >but this would be very cumbersome.</div> <div >The solution is to define a special ecFlow <a href="/wiki/display/ECFLOW/Glossary#term-variable"><em >variable</em></a> called ECF_INCLUDE</div> <div >that points to the directory containing the include files.</div> <div >We need to do the following changes to the <a href="/wiki/display/ECFLOW/Glossary#term-ecf-script"><em >ecf script</em></a>‘s.</div> </div> <p>from:</p> <div ><pre>%include "../head.h" echo "I am part of a suite that lives in %ECF_HOME%" %include "../tail.h"</pre> </div> <p>to:</p> <div ><pre>%include <head.h> echo "I am part of a suite that lives in %ECF_HOME%" %include <tail.h></pre> </div> <div > <div ><a href="/wiki/display/ECFLOW/Glossary#term-suite"><em >suite</em></a>‘s, <a href="/wiki/display/ECFLOW/Glossary#term-family"><em >family</em></a>‘s and <a href="/wiki/display/ECFLOW/Glossary#term-task"><em >task</em></a>‘s are called <a href="/wiki/display/ECFLOW/Glossary#term-node"><em >node</em></a>‘s.</div> <div >Because of this analogy with the unix file system, nodes can be addressed</div> <div >using full names: <strong>/test/f1/t1</strong> refers to the <a href="/wiki/display/ECFLOW/Glossary#term-task"><em >task</em></a> <strong>t1</strong>, and</div> <div ><strong>/test/f1</strong> refers to the <a href="/wiki/display/ECFLOW/Glossary#term-family"><em >family</em></a> <strong>f1</strong>.</div> <div >In some contexts, ecFlow will accept relative names, such as <strong>../t1</strong>.</div> </div> <p>The hierarchy is shown as a tree in <a href="/wiki/display/ECFLOW/Glossary#term-ecflowview"><em >ecflowview</em></a>.</p> <p>What to do:</p> <ol > <li>Write the suite definition</li> <li>Create the directories needed, move the <a href="/wiki/display/ECFLOW/Glossary#term-ecf-script"><em >ecf script</em></a>‘s</li> <li>Edit the script to include <a href="/wiki/display/ECFLOW/Understanding+Includes#head-h"><em>head.h</em></a> and <a href="/wiki/display/ECFLOW/Understanding+Includes#tail-h"><em>tail.h</em></a> from the ECF_INCLUDE directory.</li> <li>Load and begin the suite again</li> <li>View the suite in <a href="/wiki/display/ECFLOW/Glossary#term-ecflowview"><em >ecflowview</em></a>, notice the tree structure. You may have to unfold <strong>test</strong> and <strong>f1</strong> to see the tasks, using the middle mouse button.</li> </ol> </div> |