@@ -207,9 +207,9 @@ def __init__(self, plugin_args=None):
207
207
"""Initialize runtime attributes to none
208
208
209
209
procs: list (N) of underlying interface elements to be processed
210
- proc_done: a boolean vector (N) signifying whether a process has been
210
+ proc_done: a boolean numpy array (N) signifying whether a process has been
211
211
executed
212
- proc_pending: a boolean vector (N) signifying whether a
212
+ proc_pending: a boolean numpy array (N) signifying whether a
213
213
process is currently running. Note: A process is finished only when
214
214
both proc_done==True and
215
215
proc_pending==False
@@ -360,14 +360,14 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
360
360
if (num_jobs >= self .max_jobs ) or (slots == 0 ):
361
361
break
362
362
# Check to see if a job is available
363
- jobids = np .flatnonzero ((self .proc_done == False ) &
364
- (self .depidx .sum (axis = 0 ) == 0 ).__array__ ())
363
+ jobids = np .flatnonzero (
364
+ ~ self .proc_done & ~ np .sum (self .depidx , axis = 0 ).astype (bool ))
365
+
365
366
if len (jobids ) > 0 :
366
367
# send all available jobs
367
- if slots :
368
- logger .info ('Pending[%d] Submitting[%d] jobs Slots[%d]' % (num_jobs , len (jobids [:slots ]), slots ))
369
- else :
370
- logger .info ('Pending[%d] Submitting[%d] jobs Slots[inf]' % (num_jobs , len (jobids )))
368
+ logger .info ('Pending[%d] Submitting[%d] jobs Slots[%d]' ,
369
+ num_jobs , len (jobids [:slots ]), slots or 'inf' )
370
+
371
371
for jobid in jobids [:slots ]:
372
372
if isinstance (self .procs [jobid ], MapNode ):
373
373
try :
@@ -478,8 +478,7 @@ def _remove_node_dirs(self):
478
478
"""Removes directories whose outputs have already been used up
479
479
"""
480
480
if str2bool (self ._config ['execution' ]['remove_node_directories' ]):
481
- for idx in np .nonzero (
482
- (self .refidx .sum (axis = 1 ) == 0 ).__array__ ())[0 ]:
481
+ for idx in np .nonzero (np .sum (self .refidx , axis = 1 ) == 0 )[0 ]:
483
482
if idx in self .mapnodesubids :
484
483
continue
485
484
if self .proc_done [idx ] and (not self .proc_pending [idx ]):
0 commit comments