Esempio n. 1
0
 def run(inputs):
     """
     Runs in separate thread.
     """
     start = time.clock()
     try:
         result = task.evaluate(inputs)
     except:
         result = failure.Failure()
     finally:
         end = time.clock()
     return traverser.EvalResult(result, end - start)
Esempio n. 2
0
 def run(inputs):
     """
     Runs in separate thread.
     """
     start = time.clock()
     try:
         result = task.evaluate(inputs)
     except:
         result = failure.Failure()
     finally:
         end = time.clock()
     return traverser.EvalResult(result, end - start)
Esempio n. 3
0
 def submit_task(self, g, tick, task, inputs):
     """
     Submit a task to the DRM.        
     :param g: Graph containing the task
     :param tick: Tick of the task being evaluated.
     :param task: Task being evaluated.
     :param inputs: port -> valueref for the input ports.
     """
     if isinstance(task,HelperTask):
         dfpath=g.get_task_properties(tick)['path']
         g.set_task_property(tick, 'summary', _InPlaceExecSummary(tick, dfpath))
         return task.evaluate(g, tick, task, inputs)
     else:
         executable = load_executable(task.command, task.package.pkgname)
         job = _Job(self, g, tick, task, executable, inputs)
         logger.debug("Job added to queue: %r" % job)
         self._job_queue.add(job)
         self._submit_jobs()
         return job.result
Esempio n. 4
0
        def run(inputs):
            """
            Runs in separate thread.
            """
            logger.debug("Running job %s" % tick)

            #start = time.clock()
            start = datetime.datetime.now()
            try:
                result = task.evaluate(inputs)
            except:
                result = failure.Failure()
            finally:
                #end = time.clock()
                end = datetime.datetime.now()

                logger.debug("Running job %s finished" % tick)

            #duration = end - start
            duration = (end - start).total_seconds()
            return traverser.EvalResult(result, duration)