Late

Sometimes tasks do not complete in an expected time constrait, and the user needs to be notificatied. This notification can be performed by using late attribute.

Each node can only have one late attribute, and late attributes only apply to tasks. When a late attribute is defined on a suite or family, it will be inherited; and, any late attribute defined lower down the hierarchy will override the aspect (submitted, active, complete) defined higher up.

A late attribute defines time constraints for a task to be: submitted, active or complete.

  • -s submitted: The amount of time the node can stay submitted (format [+]hh:mm). The time value is always relative, so + is simply ignored, if present. The late flag is set if the node stays submitted longer than the specified amount of time.

  • -a active: The time of day the node must have become active (format hh:mm). The late flag is set if the node is still queued or submitted after the specified time.

  • -c complete: The amount of time node can take to become complete (format [+]hh:mm). If relative, the amount of time that the node can take to complete since becoming active; otherwise, the node must be complete by the specified time.

Listing 60 late example
task t1
   late -s +00:15 -a 20:00 -c +02:00

The late in the example above is interpreted as:

  • the node can stay submitted for a maximum of 15 minutes

  • and it must become active by 20:00

  • and the runtime must not exceed 2 hours.

For the purposes of this tutorial, the late attribute will apply a contraint to the runtime only.

Suite Definition

Modify the suite definition file, as follows:

# Definition of the suite test.
suite test
  edit ECF_INCLUDE "$HOME/course"    # replace $HOME with the path to your home directory
  edit ECF_HOME    "$HOME/course"

  family f6
       edit SLEEP 120
       task t1
            late -c +00:01 # set late flag if task take longer than a minute
  endfamily
endsuite

Task Script

Create new task script file $HOME/course/test/f6/t1.ecf, related to the new task.

Listing 62 $HOME/course/test/f6/t1.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. Create the new task script file as shown above.

  3. In the ecflow_ui, run the suite and observer the late flag being set

  4. When the job completes, requeue the family f6 or task t1, and observe that this clears the late flag.

  5. In the ecflow_ui, the late flag can also be cleared manually, by selecting task t1, and then in the Right Mouse Button context menu, select Special, and Clear late flag.