Created static method to start experiments
@@ -222,7 +222,8 @@ class QueueManager:
"""
if not self.busy[0]:
self.busy[0] = True
- process = mp.Process(target=_execute_and_update, args=(self,))
+ process = mp.Process(
+ target=QueueManager._execute_and_update, args=(self,))
process.start()
print("starting "+self.running[0])
self.process.append(process.pid)
@@ -235,9 +236,10 @@ class QueueManager:
self.pause()
self.save_state()
- def _execute_and_update(self):
- startExperiment(self.toRun[self.running[0]])
- self.busy[0]=False
+ @staticmethod
+ def _execute_and_update(queuemanager):
+ startExperiment(queuemanager.toRun[queuemanager.running[0]])
+ queuemanager.busy[0] = False
def getModel(self, batch, experimentId, iteration, modelRun):
"""
@@ -363,7 +365,3 @@ class QueueManager:
"""
self.order[:] = []
self.order.extend(newOrder)
-
-
-def _execute_and_update(queuemanager):
- queuemanager._execute_and_update()
