Dynamically creating input for a FireWork with multiple parents

So my workflow looks like this:

workflow = Workflow([parent_1,parent_2…, parent_N,child_1],{parent_1:[child_1],parent_2:[child_1]…,parent_N:[child_1]})

If parent_i succeeds, it should send a path to child_1

If parent_i fails, it should send nothing to child_1

Once all the parents have run (either with success or failure), child_1 should iterate over all the paths that were given to it and do something for each path.

In principle, there could be multiple child_j with parents [parent_1j,parent_2j… parent_Nj].

What’s the right way to structure the FireTask for ParentFireTask and ChildFireTask so that this can be achieved?

Thanks!

Hi Varchas,

The best way to do this with FWS is to have the child FireWork have “_allow_fizzled_parents” set to True in its fw_spec (minor documentation is here: https://materialsproject.github.io/fireworks/failures_tutorial.html?highlight=_allow_fizzled_parents).

With this key set, even if the parent fails it will still execute the child. In this case, it will create a special key called “_fizzled_parents” in the child’s spec, if any parents did in fact fail.

Next, the child should examine the “_fizzled_parents” key to see which of the parents actually failed. Those paths should be removed from your list.

···

On Tuesday, September 17, 2019 at 9:04:17 AM UTC-7, Varchas Gopalaswamy wrote:

So my workflow looks like this:

workflow = Workflow([parent_1,parent_2…, parent_N,child_1],{parent_1:[child_1],parent_2:[child_1]…,parent_N:[child_1]})

If parent_i succeeds, it should send a path to child_1

If parent_i fails, it should send nothing to child_1

Once all the parents have run (either with success or failure), child_1 should iterate over all the paths that were given to it and do something for each path.

In principle, there could be multiple child_j with parents [parent_1j,parent_2j… parent_Nj].

What’s the right way to structure the FireTask for ParentFireTask and ChildFireTask so that this can be achieved?

Thanks!