Skip to content

Commit

Permalink
WIP: solve issue aiidateam#6571
Browse files Browse the repository at this point in the history
  • Loading branch information
agoscinski committed Sep 26, 2024
1 parent c52ec67 commit c404f97
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/aiida/schedulers/plugins/direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,15 @@ def _parse_submit_output(self, retval, stdout, stderr):

def _get_kill_command(self, jobid):
"""Return the command to kill the job with specified jobid."""
submit_command = f'kill {jobid}'
from psutil import Process

process = Process(int(jobid))
children = process.children(recursive=True)
jobids = [jobid]
jobids.extend([str(child.pid) for child in children])
jobids_str = ' '.join(jobids)

submit_command = f'kill {jobids_str}'

self.logger.info(f'killing job {jobid}')

Expand Down

0 comments on commit c404f97

Please sign in to comment.