Skip to content

Commit 7c90d5a

Browse files
committed
Added some details about gantt chart
1 parent 126fa5d commit 7c90d5a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

doc/users/resource_sched_profiler.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,20 @@ throughput.
115115
Visualizing Pipeline Resources
116116
==============================
117117
Nipype provides the ability to visualize the workflow execution based on the
118-
runtimes and system resources each node takes.
118+
runtimes and system resources each node takes. It does this using the log file
119+
generated from the callback logger after workflow execution - as shown above.
120+
121+
::
122+
from nipype.pipeline.plugins.callback_log import log_nodes_cb
123+
args_dict = {'n_procs' : 4, 'memory_gb' : 6,
124+
'status_callback' : log_nodes_cb}
125+
workflow.run(plugin='MultiProc', plugin_args=args_dict)
126+
127+
# ...workflow finishes and writes callback log to '/home/user/run_stats.log'
128+
129+
from nipype.utils.draw_gantt_chart import generate_gantt_chart
130+
generate_gantt_chart('/home/user/run_stats.log', cores=4)
131+
# ...creates gantt chart in '/home/user/run_stats.log.html'
132+
133+
The `generate_gantt_chart`` function will create an html file that can be viewed
134+
in a browser.

0 commit comments

Comments
 (0)