Commit 790beb3f authored by Maxime Hubert's avatar Maxime Hubert
Browse files

Exceptions returned to the monitor

parent 14859bc4
Pipeline #124250 failed with stage
in 31 seconds
......@@ -69,8 +69,9 @@ class Monitor():
"""
self.main_process = Process(target=self.main_function, kwargs=self.args.__dict__)
self.main_process.start()
self.main_process_pid = os.getpid()
self.main_function(self.args)
self.monitor = Process(target=self.monitor_resources)
self.monitor.start()
......@@ -102,7 +103,7 @@ class Monitor():
# Try to retrieve the main_process
try:
process = psutil.Process(self.main_process.pid)
process = psutil.Process(self.main_process_pid)
# Load the NVIDIA handler
with NvmlHandler() as nvml_h:
......@@ -127,4 +128,4 @@ class Monitor():
except Exception as e:
logger.warning(e)
logger.info('PID {} not available for monitoring'.format(self.main_process.pid))
logger.info('PID {} not available for monitoring'.format(self.main_process_pid))
Supports Markdown
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