In the previous section we have implemented our first task (the t1.ecf file).
The t1.ecf script needs to be preprocessed to generate the job file.
...
Python
The process of job creation can be checked before the suite definition
is loaded into the ecflow_server. The following checks are done:
- Locating ecf script files, corresponding to the task in the suite definition.
- Performing pre-processing
When the suite definition is large and has many ecf script this
checking can save a lot of time.
The following point’s should be noted about about job creation checking:
- It is independent of the ecflow_server.Hence ECF_PORT and ECF_NODE in the job file will have default values.
- Job files have a .job0 extension, whereas the server will always generate jobs with a extension .job<1-n>, i.e t1.job1, t1.job2.The numbers correspond to ECF_TRYNO which is never zero.
Checking is done using ecflow.Defs.check_job_creation
#!/usr/bin/env python2.7
import os
import ecflow
print "Creating suite definition"
defs = ecflow.Defs()
suite = defs.add_suite("test")
suite.add_variable("ECF_HOME", os.getenv("HOME") + "/course")
suite.add_task("t1")
print defs
print "Checking job creation: .ecf -> .job0"
print defs.check_job_creation()
# We can assert, so that we only progress, once all job creation works
# assert len(defs.check_job_creation()) == 0, "Job generation failed"
What to do
- Add job creation checking.
- Examine the job file $HOME/course/test/t1.job0
...