Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions nipype/utils/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @Author: oesteban
# @Date: 2017-09-21 15:50:37
# @Last Modified by: oesteban
# @Last Modified time: 2017-10-02 15:44:29
# @Last Modified time: 2017-10-20 09:12:36
"""
Utilities to keep track of performance
"""
Expand Down Expand Up @@ -77,9 +77,13 @@ def _sample(self, cpu_interval=None):
except psutil.NoSuchProcess:
pass

# parent_mem = mem
# Iterate through child processes and get number of their threads
for child in self._process.children(recursive=True):
try:
children = self._process.children(recursive=True)
except psutil.NoSuchProcess:
children = []

for child in children:
try:
with child.oneshot():
cpu += child.cpu_percent()
Expand Down