+ minor changes in the paths
[qpalma.git] / scripts / ModelSelection.py
index 0fb0e3a..ebc2baf 100644 (file)
@@ -5,6 +5,8 @@ import cPickle
 import os
 import os.path
 import time
+import pdb
+import subprocess
 
 from qpalma_main import QPalma
 import Experiment as Exp
@@ -20,13 +22,15 @@ class Model:
 
       allRuns = Exp.createRuns()
       
+      #pdb.set_trace()
+      
       for currentRun in allRuns:
                
          currentInstance = QPalma(currentRun)
 
          #print 'instance created, starting to pickle configuration...'
          name = currentRun['name']
-         instance_fn = 'run_%s.pickle'%name
+         instance_fn = '%s.pickle'%name
          fh = open(instance_fn,'w+')
          cPickle.dump(currentInstance,fh)
          fh.close()
@@ -36,12 +40,32 @@ class Model:
 
    def doSelection(self):
       for instance in self.allInstances:
-         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('echo "./resurrect %s >out_%s.log 2>err_%s.log &"'%(instance,instance,instance))
+         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))
+
+
+   def doPrediction(self):
+      current_dir = '/fml/ag-raetsch/home/fabio/tmp/QPalma_single_run'
+
+      for instance in self.allInstances:
+         time.sleep(2)
+         cmd = '/fml/ag-raetsch/home/fabio/svn/projects/QPalma/scripts/doPrediction.sh %s 1>_%s.log 2>%s.log & '%(instance,instance,instance)
+         #cmd = 'echo /fml/ag-raetsch/home/fabio/svn/projects/QPalma/scripts/doPrediction.sh %s |\
+         #qsub -l h_vmem=12.0G -cwd -j y -N \"%s.log\"'%(instance,instance)
+         #os.system(cmd) 
+         obj = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+         #out,err = obj.communicate()
+         #print out,err
+
 
 
 if __name__ == '__main__':
    m = Model()
    m.createInstances()
    m.doSelection()
+   #m.doPrediction()
+