{{{ #!html

Home | About Gush | Using Gush | Gush Examples | Gush Tutorial at GEC 11 | GENI Summer Camp


}}} = Gush Tutorial at GENI Summer Camp = By default, all process blocks in Gush are run in parallel. You can change this through the use of predecessors and barriers. == Predecessors == A "predecessor" process block in Gush defines a process block that must complete before another process block can begin. This allows us to control the ordering of processes on each host. For example, suppose we have three process blocks in my experiment named p1, p2, and p3. If we want them to execute in order, we need to specify that p2 has a predecessor of p1, and p3 has a predecessor of p2. This is shown in the following app spec (replace SLICENAME with your slice): {{{ 2 echo 1 echo 2 echo 3 }}} == Barriers == While predecessors specify the order in which processes execute on each resource, they do not provide any guarantees about the order of process execution across resources. If we want to enforce a more "global" ordering, we must use barriers. A barrier block is defined in a manner similar to a process block, with the addition of a "max" attribute that indicates how many hosts must reach that point before any individual host is allowed to continue. In the following app spec, p1 and p2 run sequentially on each resource, then execution blocks on the barrier, and then p3 is run. (Note: If we remove the predecessor tag in p2, p1 and p2 would run in parallel.) {{{ 3 echo 1 echo 2 echo 3 }}} Note: Barriers can even be used across components to synchronize different types of resources. Just make sure the correct barrier "name" is used in the predecessor tags.