def report_tasks(self, report, toplevel_task_id): task = self.task_graph.get_task(toplevel_task_id) tx = TaskGraphUpdate() for (parent_id, success, payload) in report: parent_task = self.task_graph.get_task(parent_id) if success: (spawned, published) = payload for child in spawned: child_task = build_taskpool_task_from_descriptor(child, parent_task) tx.spawn(child_task) parent_task.children.append(child_task) for ref in published: tx.publish(ref, parent_task) else: # Only one failed task per-report, at the moment. self.investigate_task_failure(parent_task, payload) self.lazy_task_pool.worker_pool.worker_idle(toplevel_task_id.worker) ciel.engine.publish('schedule') return tx.commit(self.task_graph)
def report_tasks(self, report, toplevel_task_id): task = self.task_graph.get_task(toplevel_task_id) tx = TaskGraphUpdate() for (parent_id, success, payload) in report: parent_task = self.task_graph.get_task(parent_id) if success: (spawned, published) = payload for child in spawned: child_task = build_taskpool_task_from_descriptor( child, parent_task) tx.spawn(child_task) parent_task.children.append(child_task) for ref in published: tx.publish(ref, parent_task) else: # Only one failed task per-report, at the moment. self.investigate_task_failure(parent_task, payload) self.lazy_task_pool.worker_pool.worker_idle( toplevel_task_id.worker) ciel.engine.publish('schedule') return tx.commit(self.task_graph)
def spawn_tasks(self, parent_task_id, tasks): parent_task = self.task_graph.get_task(parent_task_id) tx = TaskGraphUpdate() for task_descriptor in tasks: task_object = build_taskpool_task_from_descriptor(task_descriptor, None, parent_task) tx.spawn(task_object) tx.commit(self.task_graph)
def spawn_tasks(self, parent_task_id, tasks): parent_task = self.task_graph.get_task(parent_task_id) tx = TaskGraphUpdate() for task_descriptor in tasks: task_object = build_taskpool_task_from_descriptor( task_descriptor, None, parent_task) tx.spawn(task_object) tx.commit(self.task_graph)
def spawn_and_publish(self, spawns, refs, producer=None, taskset=None): producer_task = None if producer is not None: producer_task = self.get_task(producer["task_id"]) taskset = producer_task.taskset upd = TaskGraphUpdate() for spawn in spawns: task_object = build_taskpool_task_from_descriptor(spawn, producer_task, taskset) upd.spawn(task_object) for ref in refs: upd.publish(ref, producer_task) upd.commit(self)
def spawn_and_publish(self, spawns, refs, producer=None, taskset=None): producer_task = None if producer is not None: producer_task = self.get_task(producer["task_id"]) taskset = producer_task.taskset upd = TaskGraphUpdate() for spawn in spawns: task_object = build_taskpool_task_from_descriptor( spawn, producer_task, taskset) upd.spawn(task_object) for ref in refs: upd.publish(ref, producer_task) upd.commit(self)
def _report_tasks(self, report, toplevel_task, worker): with self._lock: tx = TaskGraphUpdate() root_task = self.task_graph.get_task(report[0][0]) for assigned_worker in root_task.get_workers(): if assigned_worker is worker: self.workers[worker].deassign_task(root_task) else: self.workers[assigned_worker].deassign_task(root_task) assigned_worker.worker_pool.abort_task_on_worker( root_task, assigned_worker) # XXX: Need to abort the task running on other workers. pass for (parent_id, success, payload) in report: parent_task = self.task_graph.get_task(parent_id) if success: (spawned, published, profiling) = payload parent_task.set_profiling(profiling) parent_task.set_state(TASK_COMMITTED) self.record_task_stats(parent_task, worker) for child in spawned: child_task = build_taskpool_task_from_descriptor( child, parent_task) tx.spawn(child_task) parent_task.children.append(child_task) for ref in published: tx.publish(ref, parent_task) else: # Only one failed task per-report, at the moment. self.investigate_task_failure(parent_task, payload) self.schedule() return tx.commit(self.task_graph) self.task_graph.reduce_graph_for_references( toplevel_task.expected_outputs) # XXX: Need to remove assigned task from worker(s). self.schedule()
def _report_tasks(self, report, toplevel_task, worker): with self._lock: tx = TaskGraphUpdate() root_task = self.task_graph.get_task(report[0][0]) for assigned_worker in root_task.get_workers(): if assigned_worker is worker: self.workers[worker].deassign_task(root_task) else: self.workers[assigned_worker].deassign_task(root_task) assigned_worker.worker_pool.abort_task_on_worker(root_task, assigned_worker) # XXX: Need to abort the task running on other workers. pass for (parent_id, success, payload) in report: parent_task = self.task_graph.get_task(parent_id) if success: (spawned, published, profiling) = payload parent_task.set_profiling(profiling) parent_task.set_state(TASK_COMMITTED) self.record_task_stats(parent_task, worker) for child in spawned: child_task = build_taskpool_task_from_descriptor(child, parent_task) tx.spawn(child_task) parent_task.children.append(child_task) for ref in published: tx.publish(ref, parent_task) else: # Only one failed task per-report, at the moment. self.investigate_task_failure(parent_task, payload) self.schedule() return tx.commit(self.task_graph) self.task_graph.reduce_graph_for_references(toplevel_task.expected_outputs) # XXX: Need to remove assigned task from worker(s). self.schedule()