Horizontal Navigation Bar |
---|
Button Group |
---|
Button Hyperlink |
---|
title | Previous |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Defining+the+first+task |
---|
|
Button Hyperlink |
---|
title | Up |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Tutorial |
---|
|
Button Hyperlink |
---|
title | Next |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Checking+the+job |
---|
|
|
|
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.
This pre-processing is done automatically by ecflow_server the when the task is about to run.
However, it is possible to check the job creation before the suite definition is loaded into the ecflow_server.
Text
Automated job creation checking is only available with Python.
If the ecflow_server can’t locate the ecf script, please see ecf file location algorithm
Python
The following point’s points should be noted about about job creation checking:
Hence ECF_PORT and ECF_
NODE HOST in the
job file will have default values.
Job files have a .job0 extension, whereas the server will always generate jobs with a an 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
Update test.py with:
Code Block |
---|
language | py |
---|
title | $HOME/course/test.py |
---|
|
import os
|
importfrom ecflow import Defs,Suite,Task,Edit
print |
("Creating suite definition")
home = os.path.join(os.getenv("HOME"), "course")
defs = |
ecflow.)
suite = defs.add_suite("test")
suite.add_variable("ECF_HOME", os.getenv("HOME") + "/course")
suite.add_task("t1")
print defs
print
Suite('test',
Edit(ECF_HOME=home),
Task('t1')))
print(defs)
print("Checking job creation: .ecf -> .job0") |
(defs.check_job_creation())
# We can assert, so that we only progress |
, all job creation works
# assert len(defs.check_job_creation()) == 0, "Job generation failed" |
Note |
---|
It is highly advisable that job creation checking is enabled for all subsequent examples. |
What to do
- Add job creation checking to $HOME/course/test.py
- python3 test.py | ./test.py
- Examine the job file
$HOME/course/test/t1.job0
- In particular note the substitutions made by the ecflow server such as ECF_PORT, ECF_HOST, etc
Horizontal Navigation Bar |
---|
Button Group |
---|
Button Hyperlink |
---|
title | Previous |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Defining+the+first+task |
---|
|
Button Hyperlink |
---|
title | Up |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Tutorial |
---|
|
Button Hyperlink |
---|
title | Next |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Understanding+the+client |
---|
|
|
|
...