distributed 2021.10.0

Parameters
replicate(self, futures, n=None, workers=None, branching_factor=2, **kwargs)

Copy data onto many workers. This helps to broadcast frequently accessed data and it helps to improve resilience.

This performs a tree copy of the data throughout the network individually on each piece of data. This operation blocks until complete. It does not guarantee replication of data to future workers.

Parameters

futures : list of futures

Futures we wish to replicate

n : int, optional

Number of processes on the cluster on which to replicate the data. Defaults to all.

workers : list of worker addresses

Workers on which we want to restrict the replication. Defaults to all.

branching_factor : int, optional

The number of workers that can copy data in each generation

Set replication of futures within network

See Also

Client.rebalance

Examples

This example is valid syntax, but we were not able to check execution
>>> x = c.submit(func, *args)  # doctest: +SKIP
... c.replicate([x]) # send to all workers # doctest: +SKIP
... c.replicate([x], n=3) # send to three workers # doctest: +SKIP
... c.replicate([x], workers=['alice', 'bob']) # send to specific # doctest: +SKIP
... c.replicate([x], n=1, workers=['alice', 'bob']) # send to one of specific workers # doctest: +SKIP
... c.replicate([x], n=1) # reduce replications # doctest: +SKIP
See :

Local connectivity graph

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


File: /distributed/client.py#3122
type: <class 'function'>
Commit: