+ got rid of minor bugs
authorFabio <fabio@congo.fml.local>
Wed, 10 Sep 2008 21:03:14 +0000 (23:03 +0200)
committerFabio <fabio@congo.fml.local>
Wed, 10 Sep 2008 21:03:14 +0000 (23:03 +0200)
+ ApproximationTask is running

qpalma/gridtools.py
scripts/SettingsParser.py
scripts/qpalma_pipeline.py

index d4eb873..a6b73d6 100644 (file)
@@ -24,6 +24,8 @@ from pythongrid import process_jobs, submit_jobs, collect_jobs, get_status
 
 from createAlignmentFileFromPrediction import create_alignment_file
 
+from PipelineHeuristic import *
+
 import gridtools
 
 from utils import get_slices,split_file
@@ -70,7 +72,7 @@ class ClusterTask(Thread):
       After creation of jobs this function submits them to the cluster.
       """
       for current_job in self.functionJobs:
-         self.sid, self.jobids = submit_jobs([functionJobs])
+         self.sid, self.jobids = submit_jobs([current_job])
 
 
    def Restart(self,id):
@@ -87,12 +89,12 @@ class ClusterTask(Thread):
       while not get_status(self.sid, self.jobids):
          time.sleep(7)
       print 'collecting jobs'
-      retjobs = collect_jobs(sid, jobids, myjobs)
-      print "ret fields AFTER execution on cluster"
-      for (i, job) in enumerate(retjobs):
-         print "Job #", i, "- ret: ", job.ret
+      retjobs = collect_jobs(self.sid, self.jobids, self.functionJobs)
 
-      print '--------------'
+      #print "ret fields AFTER execution on cluster"
+      #for (i, job) in enumerate(retjobs):
+      #   print "Job #", i, "- ret: ", job.ret
+      #print '--------------'
 
 
 
@@ -130,7 +132,7 @@ class ApproximationTask(ClusterTask):
          data_fname     = jp(result_dir,'map.part_%d'%idx)
          result_fname   = jp(result_dir,'map.vm.part_%d.heuristic'%idx)
 
-         current_job = KybJob(gridtools.TaskStarter,[run_fname,data_fname,param_fname,result_fname])
+         current_job = KybJob(gridtools.ApproximationTaskStarter,[run_fname,data_fname,param_fname,result_fname])
          current_job.h_vmem = '25.0G'
          #current_job.express = 'True'
 
@@ -139,11 +141,11 @@ class ApproximationTask(ClusterTask):
          self.functionJobs.append(current_job)
 
 
-   def TaskStarter(run_fname,data_fname,param_fname,result_fname):
-      ph1 = PipelineHeuristic(run_fname,data_fname,param_fname,result_fname)
-      ph1.filter()
+def ApproximationTaskStarter(run_fname,data_fname,param_fname,result_fname):
+   ph1 = PipelineHeuristic(run_fname,data_fname,param_fname,result_fname)
+   ph1.filter()
 
-      return 'finished filtering set %s.' % data_fname
+   return 'finished filtering set %s.' % data_fname
 
 
 class PreprocessingTask(ClusterTask):
index 56f4180..7abcd59 100644 (file)
@@ -55,7 +55,13 @@ def makeSettings(global_settings):
    try:
       os.mkdir(global_settings['global_log_fn'])
    except:
-      print ('Error: There was a problem generating the logfile %s' % global_settings['global_log_fn'])
+      print 'Error: There was a problem generating the logfile %s' % global_settings['global_log_fn']
+
+   
+   try:
+      global_settings['num_splits'] = int(global_settings['num_splits'])
+   except:
+      print 'Error: num_splits has to be a positive integer'
 
    return global_settings
 
index ae24e4c..26d30e2 100644 (file)
@@ -80,28 +80,28 @@ class System:
       # After filtering combine the filtered matches from the first run and the
       # found matches from the second run to a full dataset
 
-      sys.exit(0)
-
       pre_task = PreprocessingTask(self.global_settings)
-      pre_task.createJobs()
-      pre_task.submit() 
-      pre_task.checkIfTaskFinished()
+      pre_task.CreateJobs()
+      pre_task.Submit() 
+      pre_task.CheckIfTaskFinished()
+
+      sys.exit(0)
 
       # Now that we have a dataset we can perform the accurate alignments for this
       # data
 
       align_task = AlignmentTask(self.global_settings)
-      align_task.createJobs()
-      align_task.submit()
-      align_task.checkIfTaskFinished()
+      align_task.CreateJobs()
+      align_task.Submit()
+      align_task.CheckIfTaskFinished()
 
       # The results of the above alignment step can be converted to a data format
       # needed for further postprocessing.
 
       post_task = PostprocessingTask(self.global_settings)
-      post_task.createJobs()
-      post_task.submit()
-      post_task.checkIfTaskFinished()
+      post_task.CreateJobs()
+      post_task.Submit()
+      post_task.CheckIfTaskFinished()
 
       print "Success!"