Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Horizontal Navigation Bar


Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/AdvancedAdd+a+TopicsCron
Button Hyperlink
titleUp
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/Advanced+Topics
Button Hyperlink
titleNext
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/Repeat

Sometime

Query+state


Some time it is very useful to see task-specific information in ecflowview. information in ecflow_ui
For this, we can define a label. A label is a string that is attached to a task
and that can be updated using the child command ecflow_client –label
   

Ecf Script

We will create a new family f3 with  label with a task t1.
Create ecf script $HOME/course/test/f3label/t1.ecf 


Code Block
languagebash
title $HOME/course/test/label/t1.ecf
%include <head.h>

n=1
while [[ $n -le 5 ]]                  # Loop 5 times
do
   msg="The date is now $(date)"
   ecflow_client --label=info "$msg"  # Set the label
   sleep 60                           # Wait a one minute
   (( n = $n + 1 ))
done

ecflow_client --label=info "I have now finished my work."

%include <tail.h>
 


Text

Code Block
# Definition of the suite test. Note Family f1,f2 from previous pages are omitted
suite test
 edit ECF_INCLUDE "$HOME/course"
 edit ECF_HOME    "$HOME/course"
 family f3label
     task t1
         label info ""
 endfamily
endsuite

 

 


Python

The following section shows how to add a an ecflow.Label in python: ( Note:

#!/usr/bin/env python2.7

families f1 and f2 are omitted for brevity)

Code Block
languagepy
title$HOME/course/test.py
import os
import
from ecflow import Defs,Suite,Family,Task,Edit,Trigger,Complete,Event,Meter,Time,Day,Date,Label

def 
print "Creating suite definition" defs = ecflow.Defs() suite = defs.add_suite("test") suite.add_variable("ECF_INCLUDE",
create_family_label():
    return Family("label",
                Task("t1",
                Label("info","")))
 
print("Creating suite definition")  
home = os.path.join(os.getenv("HOME"), 
+
"
/
course")
suite.add_variable("ECF_HOME",

defs = Defs( 
        Suite("test",
         
os.getenv("HOME") + "/course") suite.add_family("f3").add_task("t1").add_label("info","") print defs print
   Edit(ECF_INCLUDE=home,ECF_HOME=home),
            create_family_label()))
print(defs) 

print("Checking job creation: .ecf -> .job0"
)  
print
(defs.check_job_creation())

print("Checking trigger expressions")
assert len(defs.check()) == 0, defs.check()

print("Saving definition to file 'test.def'")
defs.save_as_defs("test.def")

What to do

  1. Modify the suite definition file or python script
  2. Create the new ecf script file $HOME/course/test/f3label/t1.ecf
  3. Replace the suite definition
  4. Watch in ecflowviewin ecflow_ui
  5. Change the label colour in ecflow_ui, Tools->Preferences...→Appearance->Node Labels
       
Horizontal Navigation Bar


Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/AdvancedAdd+a+TopicsCron
Button Hyperlink
titleUp
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/Advanced+Topics
Button Hyperlink
titleNext
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/Repeat

 

...

Query+state