Skip to content

Commit

Permalink
properly handle sigusr1
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Jul 23, 2024
1 parent 3560ed5 commit 0023c26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optimum_benchmark/launchers/device_isolation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ def assert_device_isolation(pid: int, device_ids: str, action: str):
LOGGER.warn("Make sure no other process is running on the device(s) while benchmarking.")
elif action == "error":
LOGGER.error("Signaling the isolated process to error out.")
os.kill(pid, signal.SIGUSR1)
if sys.platform == "linux":
os.kill(pid, signal.SIGUSR1)
else:
LOGGER.error("Sending an error signal is only supported on Linux. Killing the isolated process.")
os.kill(pid, signal.SIGKILL)
elif action == "kill":
LOGGER.error("Killing the isolated process.")
os.kill(pid, signal.SIGKILL)
Expand Down

0 comments on commit 0023c26

Please sign in to comment.