Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Horizontal Navigation Bar
Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/OverviewUnderstanding+the+client
Button Hyperlink
titleUp
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/Tutorial
Button Hyperlink
titleNext
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/DefiningStarting+a+newthe+suite

The next step is to let ecflow_server know about your suite or to “load” the suite definition file.

...

Python

We can ask the python script to write out the defs as ‘.def’ definition file
This can also be useful for debugging when you have a complex suite definition:
#!/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()

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

# To restore the definition from file 'test.def' we can use: 
# restored_defs = ecflow.Defs("test.def")

If you called “defs.save_as_defs()” the file test.def will be written.

This can be loaded in the server as described earlier. (See Text)

Since the Suite Definition API allows the definition to be built in memory,
it can be directly loaded into the ecflow_server.
This can be done by using ecflow.Client python class.
try:
   print "Load the in memory definition(defs) into the server"
   ci = ecflow.Client();
   ci.load(defs)
except RuntimeError, e:
   print "Failed: " + str(e);
However it is recommended that the building of the suite definition is separated
from loading it into the server. The loading should be placed into a file. client.py.
#!/usr/bin/env python2.7
import ecflow 
   
try:
    print "Loading definition in 'test.def' into the server"
    ci = ecflow.Client();   
    ci.load("test.def")      # read definition from disk and load into the server
except RuntimeError, e:
    print "Failed: " + str(e); 

If everything is OK, you should have defined a suite in the server.

Have a look in the window running the ecflow_server, and look at the log file

What to do

  1. Load the definition file. Choose between loading as a text file, or using python api.
  2. If using python examine test.def and create the file client.py.
  3. Check the log file.

If you encounter errors associated with loading the suite twice, then you
can delete all the suites in the server.

 

Code Block
ecflow_client --delete=_all_

 

The definition can then be re-loaded.
Alternatively you can use replace a suite or any node, please
type the following for help on replace.

 

Code Block
ecflow_client --help replace
Horizontal Navigation Bar
Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/OverviewUnderstanding+the+client
Button Hyperlink
titleUp
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/Tutorial
Button Hyperlink
titleNext
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/DefiningStarting+a+newthe+suite