Skip to content

Commit d09ca59

Browse files
committed
improve logging to understand #2200 (comment)
1 parent 43ff268 commit d09ca59

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,19 @@ def run(self, graph, config, updatehash=False):
103103
notrun = []
104104

105105
while not np.all(self.proc_done) or np.any(self.proc_pending):
106+
# Check to see if a job is available (jobs without dependencies not run)
107+
# See https://github.com/nipy/nipype/pull/2200#discussion_r141605722
108+
jobs_ready = np.nonzero(~self.proc_done & (self.depidx.sum(0) == 0))[1]
109+
110+
logger.info('Progress: %d jobs, %d/%d/%d/%d (done/running/pending/ready).',
111+
len(self.proc_done),
112+
np.sum(self.proc_done & ~self.proc_pending),
113+
np.sum(self.proc_done & self.proc_pending),
114+
len(self.pending_tasks),
115+
len(jobs_ready))
106116
toappend = []
107117
# trigger callbacks for any pending results
108118
while self.pending_tasks:
109-
logger.debug('Processing %d pending tasks.', len(self.pending_tasks))
110119
taskid, jobid = self.pending_tasks.pop()
111120
try:
112121
result = self._get_result(taskid)
@@ -124,6 +133,7 @@ def run(self, graph, config, updatehash=False):
124133
self._remove_node_dirs()
125134
self._clear_task(taskid)
126135
else:
136+
assert self.proc_done[jobid] and self.proc_pending[jobid]
127137
toappend.insert(0, (taskid, jobid))
128138

129139
if toappend:

0 commit comments

Comments
 (0)