Skip to content
Snippets Groups Projects

Clustertools

Closed Mads M. Pedersen requested to merge clustertools into master
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
@@ -4,14 +4,15 @@ import sys
@@ -4,14 +4,15 @@ import sys
from threading import Thread
from threading import Thread
class ClusterSimulation(Simulation):
class ClusterSimulation(Simulation):
def __init__(self, modelpath, htcfilename, hawc2exe="HAWC2MB.exe"):
def __init__(self, modelpath, htcfilename, hawc2exe="HAWC2MB.exe"):
 
print ("start")
Simulation.__init__(self, modelpath, htcfilename, hawc2exe=hawc2exe)
Simulation.__init__(self, modelpath, htcfilename, hawc2exe=hawc2exe)
self.simulation_id = [f for f in os.listdir('.') if f.endswith('.in')][0][:-3]
self.simulation_id = [f for f in os.listdir('.') if f.endswith('.in')][0][:-3]
self.simulationThread = SimulationThread(self, False)
self.resource.simulationThread.low_priority = False
self.thread = Thread(target=self.simulate)
self.thread = Thread(target=self.simulate)
self.start(1)
self.start(1)
self.wait()
self.wait()
print (self.simulationThread.res[1]) # print hawc2 output to stdout
print (self.resource.simulationThread.res[1]) # print hawc2 output to stdout
sys.exit(self.simulationThread.res[0])
sys.exit(self.resource.simulationThread.res[0])
def update_status(self, *args, **kwargs):
def update_status(self, *args, **kwargs):
Simulation.update_status(self, *args, **kwargs)
Simulation.update_status(self, *args, **kwargs)
Loading