ecflow.Meter
- class ecflow.Meter
Bases:
instance
meters can be used to indicate proportional completion of task
They are able to trigger another job, which is waiting on this proportion. Can also be used to indicate progress of a job. Meters can be used in trigger and complete expression.
Constructor:
Meter(name,min,max,<optional>color_change)
string name : The meter name
int min : The minimum and initial meter value
int max : The maximum meter value. Must be greater than min value.
int color_change<optional> : default = max, Must be between min-max, used in the GUI
Exceptions:
raises IndexError when an invalid Meter is specified
Usage:
Using a meter requires:
Defining a meter on a task:
meter = Meter('progress',0,100,100)
task.add_meter(meter)
Updating the corresponding ecf script file with the meter child command:
ecflow_client --init=$$
for i in 10 20 30 40 50 60 80 100; do
ecflow_client --meter=progress $i
sleep 2 # or do some work
done
ecflow_client --complete
Optionally addition in a trigger or complete expression for job control:
trigger task:progress ge 60
trigger and complete expression should avoid using equality i.e.:
trigger task:progress == 60
Due to network issues the meter event’s may not arrive in sequential order hence the ecflow_server will ignore meter value’s, which are less than the current value as a result triggers’s which use meter equality may never evaluate
- Meter.color_change((Meter)arg1) int :
returns the color change
- Meter.empty((Meter)arg1) bool :
Return true if the Meter is empty. Used when returning a NULL Meter, from a find
- Meter.max((Meter)arg1) int :
Return the Meters maximum value
- Meter.min((Meter)arg1) int :
Return the Meters minimum value
- Meter.name((Meter)arg1) str :
Return the Meters name as string
- Meter.value((Meter)arg1) int :
Return meters current value