+ using new parsers now
[qpalma.git] / scripts / ModelSelection.py
index a619b2a..af196e3 100644 (file)
@@ -6,6 +6,7 @@ import os
 import os.path
 import time
 
+from qpalma_main import QPalma
 import Experiment as Exp
 
 class Model:
@@ -22,23 +23,24 @@ class Model:
       for currentRun in allRuns:
                
          currentInstance = QPalma(currentRun)
-         self.allInstances.append(currentInstance)
 
          #print 'instance created, starting to pickle configuration...'
-         fh = open('config_%d.pickle'%instance_counter,'w+')
-         cPickle.dump(configObject,fh)
-         fh.close()
-
-         #print 'starting to pickle algorithm object...'
-         fh = open('lmm_%d.pickle'%instance_counter,'w+')
+         name = currentRun['name']
+         instance_fn = '%s.pickle'%name
+         fh = open(instance_fn,'w+')
          cPickle.dump(currentInstance,fh)
          fh.close()
 
+         self.allInstances.append(instance_fn)
+
    def doSelection(self):
-      for idx in range(self.numInstances):
-         time.sleep(3)
-         os.system('echo ./resurrect %d | qsub -l h_vmem=1.0G -cwd -j y -N \"model_%d.log\"'%(idx,idx))
-         #os.system('./resurrect %d >out_%d.log 2>err_%d.log &'%(idx,idx,idx))
+      for instance in self.allInstances:
+         time.sleep(2)
+         cmd = 'echo ./resurrect %s | qsub -l h_vmem=5.0G -cwd -j y -N \"%s.log\"'%(instance,instance)
+         #print cmd
+         os.system(cmd)
+
+         #os.system('echo "./resurrect %s >out_%s.log 2>err_%s.log &"'%(instance,instance,instance))
 
 
 if __name__ == '__main__':