Skip to content
Snippets Groups Projects
Commit 9ca700ee authored by Kepa Cantero's avatar Kepa Cantero Committed by Manos Angelidis
Browse files

Merged in distributed_not_closing_well (pull request #10)


[NRRPLT-0000] Distributed not killing the subprocess

Approved-by: default avatarEloy Retamino <retamino@ugr.es>
Approved-by: default avatarHossain Mahmud <hossain.mahmud@gmail.com>
parent 1c933e83
No related branches found
No related tags found
No related merge requests found
...@@ -179,7 +179,8 @@ class MPILauncher(object): ...@@ -179,7 +179,8 @@ class MPILauncher(object):
def _any_child_status(self, status): def _any_child_status(self, status):
try: try:
parent = psutil.Process(self._process.pid) parent = psutil.Process(self._process.pid)
return any([ children = parent.children(recursive=True)
return not children or any([
child.status() in status child.status() in status
for child in parent.children(recursive=True) for child in parent.children(recursive=True)
]) ])
...@@ -220,7 +221,6 @@ class MPILauncher(object): ...@@ -220,7 +221,6 @@ class MPILauncher(object):
while not self._any_child_status([psutil.STATUS_STOPPED, psutil.STATUS_ZOMBIE]): while not self._any_child_status([psutil.STATUS_STOPPED, psutil.STATUS_ZOMBIE]):
time.sleep(2) time.sleep(2)
self._kill_children() self._kill_children()
if self._any_child_status([psutil.STATUS_SLEEPING, psutil.STATUS_RUNNING]): if self._any_child_status([psutil.STATUS_SLEEPING, psutil.STATUS_RUNNING]):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment