Limit

Limits provide simple load management by limiting the number of tasks submitted by a specific ecflow_server

At ECMWF, suite designers tend to use triggers in two different ways: to represent data dependency, or as courtesy triggers (i.e. a means to manage resources). Triggers where originally designed to represent data dependency, but can artificially prevent too many jobs from executing at once and thus be used to manage queues.

The use of triggers to manage queues, although possible, is undesired as it results in suites difficult to maintain.

The concept of limit was introduced as better and first class alternative to manage limited resources. Limits are declared with the limit keyword.

InLimit

Limits are used in conjunction with inlimit, which defines a need to consider the referred limit.

A limit must be defined using limit NAME N – the limit definition is typically placed at the suite scope. Then, a limit can be imposed on a group of tasks by attaching inlimit NAME attribute to the restricted nodes. Attaching the attribute to a task adds the task to the group. Attaching it to a family adds all tasks from that family.

The effect of a limit is that no more than N tasks of a group will run at once.

A node can be limited by several limits.

Suite Definition

Create family f5 with nine tasks, modifying the suite definition file, as follows:

# Definition of the suite test.
suite test
 edit ECF_INCLUDE "$HOME/course"
 edit ECF_HOME    "$HOME/course"
 limit l1 2

 family f5
     inlimit l1
     edit SLEEP 20
     task t1
     task t2
     task t3
     task t4
     task t5
     task t6
     task t7
     task t8
     task t9
 endfamily
endsuite

Task script

Create new task scripts in $HOME/course/test/f5/ directory, each one containing:

Listing 55 $HOME/course/test/f5/t1.ecf,t2.ecf…..t9.ecf
%include <head.h>
echo "I will now sleep for %SLEEP% seconds"
sleep %SLEEP%
%include <tail.h>

What to do

  1. Apply the changes to suite definition.

  2. Apply the changes to task script.

  3. In ecflow_ui

    • Observe the triggers of the limit l1

    • Open the Info panel for l1

    • Change the value of the limit

    • Open the Why? panel for one of the queued tasks of /test/f5