Skip to content

Commit 1d7afbc

Browse files
committed
quickly return to polling function when no resources are available
1 parent 345e978 commit 1d7afbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nipype/pipeline/plugins/multiproc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ def _send_procs_to_workers(self, updatehash=False, graph=None):
204204
len(self.pending_tasks), len(jobids),
205205
free_memory_gb, self.memory_gb, free_processors, self.processors)
206206

207+
if free_memory_gb < 0.01 or free_processors == 0:
208+
logger.debug('No resources available')
209+
return
210+
207211
if len(jobids) + len(self.pending_tasks) == 0:
208212
logger.debug('No tasks are being run, and no jobs can '
209213
'be submitted to the queue. Potential deadlock')

0 commit comments

Comments
 (0)