Skip to content

Commit 2af5c1d

Browse files
committed
Removed memory profiler stuff for now
1 parent a70c81e commit 2af5c1d

File tree

3 files changed

+6
-34
lines changed

3 files changed

+6
-34
lines changed

nipype/interfaces/base.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,13 +1207,6 @@ def run_command(runtime, output=None, timeout=0.01, redirect_x=False):
12071207
The returned runtime contains a merged stdout+stderr log with timestamps
12081208
"""
12091209

1210-
# Import packages
1211-
try:
1212-
from memory_profiler import _get_memory
1213-
mem_prof = True
1214-
except:
1215-
mem_prof = False
1216-
12171210
# Init variables
12181211
PIPE = subprocess.PIPE
12191212
cmdline = runtime.cmdline

nipype/interfaces/utility.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,7 @@ def _run_interface(self, runtime):
442442
if isdefined(value):
443443
args[name] = value
444444

445-
# mem stuff
446-
import memory_profiler
447-
proc = (function_handle, (), args)
448-
mem_mb, out = memory_profiler.memory_usage(proc=proc, retval=True, include_children=True, max_usage=True)
449-
setattr(runtime, 'real_memory2', mem_mb[0]/1024.0)
450-
#out = function_handle(**args)
445+
out = function_handle(**args)
451446

452447
if len(self._output_names) == 1:
453448
self._out[self._output_names[0]] = out

nipype/pipeline/plugins/multiproc.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,11 @@
1616
def run_node(node, updatehash, plugin_args=None):
1717
result = dict(result=None, traceback=None)
1818
try:
19-
run_memory = plugin_args['memory_profile']
20-
except Exception:
21-
run_memory = False
22-
if run_memory:
23-
import memory_profiler
24-
import datetime
25-
proc = (node.run, (), {'updatehash' : updatehash})
26-
start = datetime.datetime.now()
27-
mem_mb, retval = memory_profiler.memory_usage(proc=proc, retval=True, include_children=True, max_usage=True)
28-
runtime = (datetime.datetime.now() - start).total_seconds()
29-
result['result'] = retval
30-
result['real_memory'] = mem_mb[0]/1024.0
31-
result['real_memory2'] = retval.runtime.get('real_memory2')
32-
result['run_seconds'] = runtime
33-
else:
34-
try:
35-
result['result'] = node.run(updatehash=updatehash)
36-
except:
37-
etype, eval, etr = sys.exc_info()
38-
result['traceback'] = format_exception(etype,eval,etr)
39-
result['result'] = node.result
19+
result['result'] = node.run(updatehash=updatehash)
20+
except:
21+
etype, eval, etr = sys.exc_info()
22+
result['traceback'] = format_exception(etype,eval,etr)
23+
result['result'] = node.result
4024
return result
4125

4226

0 commit comments

Comments
 (0)