Skip to content

[FIX] Resource monitoring minor bugfix #2244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2017
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