@@ -89,7 +89,7 @@ def completed(self) -> int:
89
89
"""The number of completed internal jobs."""
90
90
return len (self ._completed )
91
91
92
- def receive_scatter_output (self , index : int , jobout : CWLObjectType , processStatus : str ) -> None :
92
+ def receive_scatter_output (self , index : int , runtimeContext : RuntimeContext , jobout : CWLObjectType , processStatus : str ) -> None :
93
93
"""Record the results of a scatter operation."""
94
94
for key , val in jobout .items ():
95
95
self .dest [key ][index ] = val
@@ -102,6 +102,8 @@ def receive_scatter_output(self, index: int, jobout: CWLObjectType, processStatu
102
102
if processStatus != "success" :
103
103
if self .processStatus != "permanentFail" :
104
104
self .processStatus = processStatus
105
+ if runtimeContext .on_error == "kill" :
106
+ self .output_callback (self .dest , self .processStatus )
105
107
106
108
if index not in self ._completed :
107
109
self ._completed .add (index )
@@ -156,7 +158,7 @@ def parallel_steps(
156
158
except WorkflowException as exc :
157
159
_logger .error ("Cannot make scatter job: %s" , str (exc ))
158
160
_logger .debug ("" , exc_info = True )
159
- rc .receive_scatter_output (index , {}, "permanentFail" )
161
+ rc .receive_scatter_output (index , runtimeContext , {}, "permanentFail" )
160
162
if not made_progress and rc .completed < rc .total :
161
163
yield None
162
164
@@ -185,7 +187,7 @@ def nested_crossproduct_scatter(
185
187
if len (scatter_keys ) == 1 :
186
188
if runtimeContext .postScatterEval is not None :
187
189
sjob = runtimeContext .postScatterEval (sjob )
188
- curriedcallback = functools .partial (rc .receive_scatter_output , index )
190
+ curriedcallback = functools .partial (rc .receive_scatter_output , index , runtimeContext )
189
191
if sjob is not None :
190
192
steps .append (process .job (sjob , curriedcallback , runtimeContext ))
191
193
else :
@@ -197,7 +199,7 @@ def nested_crossproduct_scatter(
197
199
process ,
198
200
sjob ,
199
201
scatter_keys [1 :],
200
- functools .partial (rc .receive_scatter_output , index ),
202
+ functools .partial (rc .receive_scatter_output , index , runtimeContext ),
201
203
runtimeContext ,
202
204
)
203
205
)
@@ -257,7 +259,7 @@ def _flat_crossproduct_scatter(
257
259
if len (scatter_keys ) == 1 :
258
260
if runtimeContext .postScatterEval is not None :
259
261
sjob = runtimeContext .postScatterEval (sjob )
260
- curriedcallback = functools .partial (callback .receive_scatter_output , put )
262
+ curriedcallback = functools .partial (callback .receive_scatter_output , put , runtimeContext )
261
263
if sjob is not None :
262
264
steps .append (process .job (sjob , curriedcallback , runtimeContext ))
263
265
else :
@@ -307,7 +309,7 @@ def dotproduct_scatter(
307
309
308
310
if runtimeContext .postScatterEval is not None :
309
311
sjobo = runtimeContext .postScatterEval (sjobo )
310
- curriedcallback = functools .partial (rc .receive_scatter_output , index )
312
+ curriedcallback = functools .partial (rc .receive_scatter_output , index , runtimeContext )
311
313
if sjobo is not None :
312
314
steps .append (process .job (sjobo , curriedcallback , runtimeContext ))
313
315
else :
0 commit comments