From 2bf15695eddd6ae2cd9e24b77866f92b9d72e0a8 Mon Sep 17 00:00:00 2001 From: oesteban Date: Fri, 1 Dec 2017 13:40:30 -0800 Subject: [PATCH] [ENH] Logging - indicate whether the node was cached This PR introduces a minimal modification to the logging trace that happens when a node has been run. --- nipype/pipeline/plugins/base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nipype/pipeline/plugins/base.py b/nipype/pipeline/plugins/base.py index bab2812903..5bb03ef3d9 100644 --- a/nipype/pipeline/plugins/base.py +++ b/nipype/pipeline/plugins/base.py @@ -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).', @@ -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