Skip to content

Commit

Permalink
Ensure the fast model shuts down when FastmodelAgent is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisswinchatt-arm authored and saheerb committed Apr 11, 2022
1 parent 003505d commit ab0f6de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fm_agent/fm_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import sys
import os
from subprocess import Popen
import time
import socket
from .utils import *
Expand Down Expand Up @@ -55,6 +56,10 @@ def __init__(self, model_name=None, model_config=None, logger=None, enable_gdbse
else:
pass

def __del__(self):
if isinstance(self.subprocess, Popen):
self.subprocess.kill()

def setup_simulator(self, model_name, model_config):
""" setup the simulator, this is crucial before you can start a simulator.
@param model_name is the specific model name need to be launched
Expand Down

0 comments on commit ab0f6de

Please sign in to comment.