i want to define a graph/job with some ops that ca...
# ask-community
n
i want to define a graph/job with some ops that can run simultaneously (independent) and when they finish - a final op will start. I have something like this in my graph:
fanouts=[]
sublists=['list','with','locations','with','ever_changing','list_length']
for i in range(len(sublists)):
fanouts.append(getCritOp(locs=sublists[i])())
#finally, this op should execute after all the others are successful
combineCritdata(list=fanouts)()
Note the extra () on getCritOp and combineCritdata - these are op factories
Currently in this state , 3 ops will start, and the first two will finish, then the combineCritdata will start prematurely (i have max_concurrent = 3 configured) . I need it to require the other 3 (or however many it will be, i dont know) to finish first.
🌈 1
👏 1
🤖 1
o
in order to define dependencies, you'll want to pass in the fanouts to the op invocation, rather than the op factory itself. So this would look something like
combineCritdata()(start_after=fanouts)
, assuming combineCritdata looks something like
Copy code
def combineCritdata():
    @op(name="combineCritdata", ins={"start_after": In(Nothing)})
    def my_op():
        ...
    return my_op
n
This worked thank you so much!