def process_all(self):
    """
    process all desired_results in the database
    """
    self.lap_timer()  # reset timer
    q = self.query_pending_desired_results()

    if self.interface.parallel_compile:
      desired_results = []
      thread_args = []

      def compile_result(args):
        interface, data, result_id = args
        return interface.compile(data, result_id)

      for dr in q.all():
        if self.claim_desired_result(dr):
          desired_results.append(dr)
          thread_args.append((self.interface, dr.configuration.data, dr.id))
      if len(desired_results) == 0:
        return
      thread_pool = ThreadPool(len(desired_results))
      # print 'Compiling %d results' % len(thread_args)
      try:
        # Use map_async instead of map because of bug where keyboardinterrupts are ignored
        # See http://stackoverflow.com/questions/1408356/keyboard-interrupts-with-pythons-multiprocessing-pool
        compile_results = thread_pool.map_async(compile_result,
                                                thread_args).get(9999999)
      except Exception:
        # Need to kill other processes because only one thread receives
        # exception
        self.interface.kill_all()
        raise
      # print 'Running %d results' % len(thread_args)
      for dr, compile_result in zip(desired_results, compile_results):
        # Make sure compile was successful
        self.run_desired_result(dr, compile_result, dr.id)
        try:
          self.interface.cleanup(dr.id)
        except __HOLE__, e:
          print e
          # print 'Done!'
    else:
      for dr in q.all():
        if self.claim_desired_result(dr):
          self.run_desired_result(dr)
dataset/ETHPy150Open jansel/opentuner/opentuner/measurement/driver.py/MeasurementDriver.process_all