Example #1
0
def create_ensemble_family():
    ensemble_family = Family("ensemble_family").add_trigger(
        "prep_task == complete")
    ensemble_family.add_variable("PYSCRIPT",
                                 os.path.join(home, 'run_ecflow.py'))
    ensemble_family.add_variable("RAPID_EXEC", '/home/michael/rapid/run/rapid')
    ensemble_family.add_variable("EXEC_DIR", '/home/michael/execute')
    ensemble_family.add_variable("SUBPROCESS_DIR",
                                 '/home/michael/subprocess_logs')
    ensemble_family += [Task(f"ens_member_52").add_variable("JOB_INDEX", 0)]
    ensemble_family += [
        Task(f"ens_member_{j}").add_variable(
            "JOB_INDEX", 52 - j).add_trigger(f"ens_member_{j + 1} == complete")
        for j in reversed(range(1, 52))
    ]
    return ensemble_family
Example #2
0
def create_family_f1():
    return Family(
        "f1",
        Edit(SLEEP=20),
        Task("t1",
             Time("03:00 23:00 00:30")),
        Task("t2",
             Day("sunday")),
        Task("t3",
             Date("1.*.*"),
             Time("12:00")
             ),
        Task("t4",
             Time("+00:02")),
        Task("t5",
             Time("00:02"))
    )
Example #3
0
def create_family_f4():
    return Family(
        "f4", Edit(SLEEP=2),
        RepeatString("NAME", ["a", "b", "c", "d", "e", "f"]),
        Family(
            "f5", RepeatInteger("VALUE", 1, 10),
            Task("t1", RepeatDate("DATE", 20101230, 20110105),
                 Label("info", ""), Label("date", ""))))
Example #4
0
def create_family_f5():
    return Family(
        "f5", InLimit("l1"),
        Edit(SLEEP=20,
             HOST='login08',
             ECF_LOGHOST="%HOST%",
             ECF_LOGPORT="33084",
             ECF_JOB_CMD="ssh %HOST% '%ECF_JOB% >& %ECF_JOBOUT%'"),
        [Task('t{}'.format(i)) for i in range(1, 10)])
Example #5
0
def create_family_f1():
    return Family(
        "f1",
        Edit(SLEEP=20),
        Task("t1",
             Meter("progress", 1, 100, 90)),
        Task("t2",
             Trigger("t1 == complete"),
             Event('a'),
             Event('b')),
        Task("t3",
             Trigger("t2:a")),
        Task("t4",
             Trigger("t2 == complete"),
             Complete("t2:b")),
        Task("t5",
             Trigger("t1:progress ge 30")),
        Task("t6",
             Trigger("t1:progress ge 60")),
        Task("t7",
             Trigger("t1:progress ge 90"))
    )
Example #6
0
def create_family_f3():
    return Family("f3",
                  Task("t1",
                       Label("info", "")))
Example #7
0
def create_family_house_keeping():
    return Family("house_keeping",
                  Task("clear_log",
                       Cron("22:30", days_of_week=[0])))
Example #8
0
import os
from pathlib import Path
from ecflow import Defs, Suite, Task, Edit

print("Creating suite definition")
home = os.path.abspath(Path(Path(__file__).parent, "../../../build/course"))
defs = Defs(Suite('test', Edit(ECF_HOME=home), Task('t1')))
print(defs)
Example #9
0
def create_family_f5():
    return Family("f5", InLimit("l1"), Edit(SLEEP=20),
                  [Task('t{}'.format(i)) for i in range(1, 10)])
Example #10
0
def create_family_f1():
    return Family("f1", Edit(SLEEP=20), Task("t1"),
                  Task("t2", Trigger("t1 == complete")))
Example #11
0
def create_family_f6():
    return Family("f6",
                  Edit(SLEEP=120),
                  Task('t1',
                       Late(complete="+00:01")))
Example #12
0
def create_family_f1():
    return Family("f1", Edit(SLEEP=20), Task("t1"), Task("t2"))
Example #13
0
def create_family_f1():
    return Family(
        "f1", Edit(SLEEP=20), Task("t1"),
        Task("t2", Trigger("t1 == complete"), Event('a'), Event('b')),
        Task("t3", Trigger("t2:a")),
        Task("t4", Trigger("t2 == complete"), Complete("t2:b")))
import os
from pathlib import Path
from ecflow import Defs, Suite, Task, Edit, Client

print("Creating suite definition")
home = os.path.abspath(Path(Path(__file__).parent, "../../../build/course"))
defs = Defs(
    Suite('test',
          Edit(ECF_HOME=home),
          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(str(Path(home, "test.def")))

try:
    print("Load the in memory definition(defs) into the server")
    ci = Client('login05', '33083')
    ci.load(defs)
except RuntimeError as e:
    print("Failed:", e)
Example #15
0
def create_family_f1():
    return Family("f1", Task("t1"), Task("t2"))