Skip to content

Commit

Permalink
Put a single CalcJob with a transport request
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Oct 30, 2024
1 parent 7057238 commit 7785525
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/aiida/engine/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,21 @@ def kill_process(_num, _frame):
LOGGER.critical('runner received interrupt, killing process %s', process_inited.pid)
process_inited.kill(msg='Process was killed because the runner received an interrupt')

original_handler_int = signal.getsignal(signal.SIGINT)
original_handler_term = signal.getsignal(signal.SIGTERM)
# TODO: only do this if the node is CalcJob
authinfo = process_inited.node.get_authinfo()

try:
signal.signal(signal.SIGINT, kill_process)
signal.signal(signal.SIGTERM, kill_process)
process_inited.execute()
finally:
signal.signal(signal.SIGINT, original_handler_int)
signal.signal(signal.SIGTERM, original_handler_term)
with self.transport.request_transport(authinfo):

original_handler_int = signal.getsignal(signal.SIGINT)
original_handler_term = signal.getsignal(signal.SIGTERM)

try:
signal.signal(signal.SIGINT, kill_process)
signal.signal(signal.SIGTERM, kill_process)
process_inited.execute()
finally:
signal.signal(signal.SIGINT, original_handler_int)
signal.signal(signal.SIGTERM, original_handler_term)

return process_inited.outputs, process_inited.node

Expand Down

0 comments on commit 7785525

Please sign in to comment.