You must also create a file t2.ecf in $HOME/course/test. Simply copy t1.ecf.
First modify the suite definition
Text
# Definition of the suite test
suite test
edit ECF_HOME "$HOME/course" # replace '$HOME' with the path to your home directory
task t1
task t2
endsuite
As before replace $HOME with the real path to your home directory.
Then you must load the file again:
> ecflow_client --load test.def
Because the suite is already defined, you need to delete and reload it first:
> ecflow_client --delete=_all_
> ecflow_client --load=test.def
Then restart the suite:
> ecflow_client --begin=test
> ecflow_client --replace /test test.def
or to replace part of the suite:
> ecflow_client --replace /test/t2 test.def
Python
To delete the suite definition, reload and begin using the Client Server API: First update test.py
#!/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")
suite.add_task("t2")
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 delete all suites in the server and reload modified test.def, we could update client.py
#!/usr/bin/env python2.7
import ecflow
print "Client -> Server: delete, then load a new definition"
try:
ci = ecflow.Client()
ci.delete_all() # clear out the server
ci.load("test.def") # load the definition into the server
ci.begin_suite("test") # start the suite
except RuntimeError, e:
print "Failed: " + str(e)
#!/usr/bin/env python2.7
import ecflow
print "Client -> Server: replacing suite '/test' in the server, with a new definition"
try:
ci = ecflow.Client()
ci.suspend("/test") # so that we can resume manually in ecflowview
ci.replace("/test", "test.def")
except RuntimeError, e:
print "Failed: " + str(e)
What to do
- Suspend the suite using ecflowview or via python using ecflow.Client.suspend
- Create the new task
- Create t2.ecf by copying from t1.ecf
- Update python scripts test.py and client.py or test.def
- Replace the suite
- Resume the the suite using ecflowview
- In ecflowview, watch the two task running. They should run at the same time