Skip to content

[ENH] Logging - indicate whether the node was cached #2323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions nipype/pipeline/plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _local_hash_check(self, jobid, graph):
logger.debug('Skipping cached node %s with ID %s.',
self.procs[jobid]._id, jobid)
try:
self._task_finished_cb(jobid)
self._task_finished_cb(jobid, cached=True)
self._remove_node_dirs()
except Exception:
logger.debug('Error skipping cached node %s (%s).',
Expand All @@ -349,13 +349,14 @@ def _local_hash_check(self, jobid, graph):
return True
return False

def _task_finished_cb(self, jobid):
def _task_finished_cb(self, jobid, cached=False):
""" Extract outputs and assign to inputs of dependent tasks

This is called when a job is completed.
"""
logger.info('[Job finished] jobname: %s jobid: %d' %
(self.procs[jobid]._id, jobid))
logger.info('[Job %d] %s (%s).', jobid,
'Cached' if cached else 'Completed',
self.procs[jobid].fullname)
if self._status_callback:
self._status_callback(self.procs[jobid], 'end')
# Update job and worker queues
Expand Down