init_rpc

paddle.distributed.rpc. init_rpc ( name, rank=None, world_size=None, master_endpoint=None ) [source]

init rpc.

Parameters
  • name (str) – worker name.

  • rank (int, optional) – worker id, default is None.

  • world_size (int, optional) – number of workers, default is None.

  • master_endpoint (str, optional) – id address of master, other nodes communicate with the master to get the information of all worker nodes, default is None.

Returns

None.

Examples

>>> 
>>> import paddle.distributed.rpc as rpc

>>> rpc.init_rpc("worker0", rank=0, world_size=1,
...             master_endpoint="127.0.0.1:8001")

>>> rpc.shutdown()