run_on_scheduler(self, function, *args, **kwargs)
This is typically used for live debugging. The function should take a keyword argument dask_scheduler=
, which will be given the scheduler object itself.
Run a function on the scheduler process
Client.run
Run a function on all workers
Client.start_ipython_scheduler
Start an IPython session on scheduler
>>> def get_number_of_tasks(dask_scheduler=None):This example is valid syntax, but we were not able to check execution
... return len(dask_scheduler.tasks)
>>> client.run_on_scheduler(get_number_of_tasks) # doctest: +SKIP 100
Run asynchronous functions in the background:
This example is valid syntax, but we were not able to check execution>>> async def print_state(dask_scheduler): # doctest: +SKIPThis example is valid syntax, but we were not able to check execution
... while True:
... print(dask_scheduler.status)
... await asyncio.sleep(1)
>>> c.run(print_state, wait=False) # doctest: +SKIPSee :
The following pages refer to to this document either explicitly or contain code examples using this.
distributed.scheduler.Scheduler.run_function
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them