...
autoarchive will write a portion of the definition to disk and autorestore can restore from disk on re-queue/begin
- Archives suite or family nodes *IF* they have child nodes(otherwise does nothing).
- Saves the suite/family nodes to disk, and then removes the in memory child nodes from the definition.
- It improves time taken to checkpoint and reduces network bandwidth
- If the node is re-queued or begun, the child nodes are automatically restored
- The nodes are saved to ECF_HOME/<host>.<port>.ECF_NAME.check, where '/' has been replaced with ':' in ECF_NAME
- Care must be taken if you have trigger reference to the archived nodes
Use ecflow_client --archive to archive manually
- ecflow_client --archive=/s1 # archive suite s1
- ecflow_client --archive=/s1/f1 /s2 # archive family /s1/f1 and suite /s2
- ecflow_client --archive=force /s1 /s2 # archive suites /s1,/s2 even if they have active tasks
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
import os
from ecflow import Defs,Suite,Family,Task,Edit,Trigger,Complete,Event,Meter,Time,Day,Date,Label, \
RepeatString,RepeatInteger,RepeatDate,InLimit,Limit
def create_family(name) :
famreturn = Family(name,
Autoarchive(0),
[ Task('t{}'.format(i)) for i in range(1,10) ] )
fam.add_autoarchive(0)
return fam
def create_family_restore() :
famreturn = Family("restore"),
fam.add_trigger Trigger("./lf1 == complete and ./lf2 == complete and ./lf3 == complete"),
fam.add_autorestore Autorestore(["./lf1","./lf2","./lf3"])
return fam
print("Creating suite definition")
home = os.path.join(os.getenv("HOME"),"course")
defs = Defs(
Suite("test",
Edit(ECF_INCLUDE=home,ECF_HOME=home,SLEEP=20),
create_family("lf1"),create_family("lf2"),create_family("lf3"),
create_family_restore()
)
)
print(defs)
print("Checking job creation: .ecf -> .job0")
print(defs.check_job_creation())
print("Checking trigger expressions and inlimits")
assert len(defs.check()) == 0,defs.check()
print("Saving definition to file 'test.def'")
defs.save_as_defs("test.def") |
...