Skip to content

Commit e50226e

Browse files
committed
[FIX] Do not break when building profiling summary
Throw a warning instead.
1 parent 68e8ef0 commit e50226e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nipype/pipeline/engine/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,13 @@ def write_workflow_resources(graph, filename=None):
13371337
rt_list = [rt_list]
13381338

13391339
for subidx, runtime in enumerate(rt_list):
1340-
nsamples = len(runtime.prof_dict['time'])
1340+
try:
1341+
nsamples = len(runtime.prof_dict['time'])
1342+
except AttributeError:
1343+
logger.warning(
1344+
'Could not retrieve profiling information for node "%s" '
1345+
'(mapflow %d/%d).', nodename, subidx + 1, len(rt_list))
1346+
continue
13411347

13421348
for key in ['time', 'mem_gb', 'cpus']:
13431349
big_dict[key] += runtime.prof_dict[key]

0 commit comments

Comments
 (0)