Skip to content

Commit 6ac0bc3

Browse files
committed
Changed thread count logic
1 parent 54a2c63 commit 6ac0bc3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nipype/interfaces/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,11 @@ def _get_num_threads(proc):
12281228

12291229
# Iterate through child processes and get number of their threads
12301230
try:
1231+
num_children = len(proc.children())
12311232
for child in proc.children(recursive=True):
1232-
num_threads += child.num_threads()
1233+
#num_threads += child.num_threads()
1234+
num_threads = max(num_threads, num_children,
1235+
child.num_threads(), len(child.children()))
12331236
except psutil.NoSuchProcess:
12341237
pass
12351238

0 commit comments

Comments
 (0)