Skip to content

Commit 9e5210f

Browse files
committed
fix error in run_examples.py and add MultiProcResourceProfiler in docs.
Fixes nipy#1526 Fixes nipy#1428
1 parent 6935526 commit 9e5210f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

doc/users/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
pipeline_tutorial
2323
plugins
24+
resource_ched_profiler
2425
config_file
2526
debug
2627

doc/users/plugins.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ the number of used resources (to say 2 CPUs), you can call::
8383

8484
workflow.run(plugin='MultiProc', plugin_args={'n_procs' : 2}
8585

86+
87+
MultiProc: profiling resources
88+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89+
90+
The ``MultiProc`` plugin can profile memory and cpu usage,
91+
please see :ref:`resource_ched_profiler` for a comprehensive description.
92+
93+
8694
IPython
8795
-------
8896

tools/run_examples.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def run_examples(example, pipelines, data_path, plugin=None, rm_base_dir=True):
5252
pipeline == 'l2pipeline':
5353
# Init callback log
5454
import logging
55-
cb_log_path = os.path.join(os.path.expanduser('~'), 'callback.log')
55+
cb_log_path = os.path.abspath('callback.log')
5656
cb_logger = logging.getLogger('callback')
5757
cb_logger.setLevel(logging.DEBUG)
5858
handler = logging.FileHandler(cb_log_path)
@@ -73,9 +73,9 @@ def run_examples(example, pipelines, data_path, plugin=None, rm_base_dir=True):
7373
except ImportError as exc:
7474
pandas_flg = False
7575

76-
if plugin_args.has_key('status_callback') and pandas_flg:
76+
if plugin_args.get('status_callback', False) and pandas_flg:
7777
draw_gantt_chart.generate_gantt_chart(cb_log_path, 4)
78-
dst_log_html = os.path.join(os.path.expanduser('~'), 'callback.log.html')
78+
dst_log_html = os.path.abspath('callback.log.html')
7979
copyfile(cb_log_path + '.html', dst_log_html)
8080

8181

0 commit comments

Comments
 (0)