IPython Documentation

Table Of Contents

Previous topic

Module: parallel.controller.hub

Next topic

Module: parallel.controller.sqlitedb

This Page


This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: parallel.controller.scheduler

The Python scheduler for rich scheduling.

The Pure ZMQ scheduler does not allow routing schemes other than LRU, nor does it check msg_id DAG dependencies. For those, a slightly slower Python Scheduler exists.


  • Min RK

2 Classes

class IPython.parallel.controller.scheduler.Job(msg_id, raw_msg, idents, msg, header, metadata, targets, after, follow, timeout)

Bases: object

Simple container for a job

__init__(msg_id, raw_msg, idents, msg, header, metadata, targets, after, follow, timeout)
class IPython.parallel.controller.scheduler.TaskScheduler(**kwargs)

Bases: IPython.kernel.zmq.session.SessionFactory

Python TaskScheduler object.

This is the simplest object that supports msg_id based DAG dependencies. Only task msg_ids are checked, not msg_ids of jobs submitted via the MUX queue.


Called after self.targets[idx] just got the job with header. Override with subclasses. The default ordering is simple LRU. The default loads are the number of outstanding jobs.


return a list of available engine indices based on HWM


dispatch register/unregister events.


handle reply to our initial connection request


dispatch method for result replies


Dispatch job submission to appropriate handlers.

fail_unreachable(msg_id, why=<class 'IPython.parallel.error.ImpossibleDependency'>)

a task has become unreachable, send a reply with an ImpossibleDependency error.


Called after self.targets[idx] just finished a job. Override with subclasses.

handle_result(idents, parent, raw_msg, success=True)

handle a real task result, either success or failure


Deal with jobs resident in an engine that died.

handle_unmet_dependency(idents, parent)

handle an unmet dependency


callback for a job’s timeout.

The job may or may not have been run at this point.


check location dependencies, and run if they are met.


Resume accepting jobs.


Save a message for later submission when its dependencies are met.


Stop accepting jobs while there are no engines. Leave them in the ZMQ queue.

submit_task(job, indices=None)

Submit a task to any of a subset of our targets.

update_graph(dep_id=None, success=True)

dep_id just finished. Update our dependency graph and submit any jobs that just became runnable.

Called with dep_id=None to update entire graph for hwm, but without finishing a task.

7 Functions


Plain random pick.


Always pick the front of the line.

The content of loads is ignored.

Assumes LRU ordering of loads, with oldest first.


Pick two at random, use the LRU of the two.

The content of loads is ignored.

Assumes LRU ordering of loads, with oldest first.


Pick two at random using inverse load as weight.

Return the less loaded of the two.


Always choose the lowest load.

If the lowest load occurs more than once, the first occurance will be used. If loads has LRU ordering, this means the LRU of those with the lowest load is chosen.

IPython.parallel.controller.scheduler.launch_scheduler(in_addr, out_addr, mon_addr, not_addr, reg_addr, config=None, logname='root', log_url=None, loglevel=10, identity='task', in_thread=False)