Hey Anubhav,
So I created a couple custom tasks to create workflows instead of using ScriptTask. I'm still having the issue where Firework1 updates to COMPLETED while the workflow created by its task is still in the RUNNING state. Do you have any idea why this is happening?
My custom task resembles the following:
class CustomTask(FireTaskBase):
_fw_name = "Custom Task"
required_params = ["param1", "param2"]
def run_task(self, fw_spec):
t1 = CustomTask2(param="param")
t2 = ScriptTask.from_str(...)
etc.
fw1 = Firework(t1, fw_id=1, name="name1")
fw2 = Firework(t2, fw_id=2, name="name2")
etc.
workflow = Workflow([fw1, fw2, fw3, fw4, etc.], {fw1: fw2, fw2:fw4, fw3:fw4, etc.}, name="workflow_name")
launchpad = LaunchPad()
launchpad.add_wf(workflow)
launch_multiprocess(launchpad, FWorker(), "Info", 0, 12, 0, None, 12)
for id in workflow.root_fw_ids:
wf_summary = launchpad.get_wf_summary_dict(id, mode="less")
wf_state = wf_summary["state"]
if wf_state == FIZZLED:
raise RuntimeError("Workflow Fizzled")
return FWAction()
class CustomTask2(FireTaskBase):
_fw_name = "Custom Task 2"
required_params = ["param"]
def run_task(self, fw_spec):
# define another workflow of ScriptTasks and add to launchpad
# multi-launch
main workflow contains about a dozen CustomTask fireworks with a complex dependency tree. It appears that either CustomTask is completing before the Fireworks in its workflow have all completed, or the Firework containing the CustomTask is getting updated to COMPLETED before the task is actually complete.
Any thoughts?