Skip to content

Commit b72f9aa

Browse files
committed
allow disable resource_monitor appending with nipype option
1 parent 75cb366 commit b72f9aa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/users/config_file.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ Execution
162162
being used by an interface. Requires ``resource_monitor`` to be ``true``.
163163
(default value: ``1``)
164164

165+
*resource_monitor_append*
166+
Append to an existing ``resource_monitor.json`` in the workflow ``base_dir``.
167+
(unset by default, possible values: ``true``, ``false``,
168+
will append unless explicitly set to ``false``).
169+
165170
Example
166171
~~~~~~~
167172

nipype/pipeline/engine/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ def write_workflow_prov(graph, filename=None, format='all'):
12981298
return ps.g
12991299

13001300

1301-
def write_workflow_resources(graph, filename=None, append=True):
1301+
def write_workflow_resources(graph, filename=None, append=None):
13021302
"""
13031303
Generate a JSON file with profiling traces that can be loaded
13041304
in a pandas DataFrame or processed with JavaScript like D3.js
@@ -1307,6 +1307,10 @@ def write_workflow_resources(graph, filename=None, append=True):
13071307
if not filename:
13081308
filename = os.path.join(os.getcwd(), 'resource_monitor.json')
13091309

1310+
if append is None:
1311+
append = str2bool(config.get(
1312+
'execution', 'resource_monitor_append', 'true'))
1313+
13101314
big_dict = {
13111315
'time': [],
13121316
'name': [],

0 commit comments

Comments
 (0)