+ added minor functionality pprinting ...
[qpalma.git] / scripts / ModelSelection.py
1 #!/usr/bin/env python
2 # -*- coding:latin-1 -*-
3
4 import cPickle
5 import os
6 import os.path
7 import time
8
9 import Experiment as Exp
10
11 class Model:
12
13 allInstances = []
14
15 def __init__(self):
16 pass
17
18 def createInstances(self):
19
20 allRuns = Exp.createRuns()
21
22 for currentRun in allRuns:
23
24 currentInstance = QPalma(currentRun)
25 self.allInstances.append(currentInstance)
26
27 #print 'instance created, starting to pickle configuration...'
28 fh = open('config_%d.pickle'%instance_counter,'w+')
29 cPickle.dump(configObject,fh)
30 fh.close()
31
32 #print 'starting to pickle algorithm object...'
33 fh = open('lmm_%d.pickle'%instance_counter,'w+')
34 cPickle.dump(currentInstance,fh)
35 fh.close()
36
37 def doSelection(self):
38 for idx in range(self.numInstances):
39 time.sleep(3)
40 os.system('echo ./resurrect %d | qsub -l h_vmem=1.0G -cwd -j y -N \"model_%d.log\"'%(idx,idx))
41 #os.system('./resurrect %d >out_%d.log 2>err_%d.log &'%(idx,idx,idx))
42
43
44 if __name__ == '__main__':
45 m = Model()
46 m.createInstances()
47 m.doSelection()