get_all_worker_infos

paddle.distributed.rpc. get_all_worker_infos ( ) [源代码]

获取所有 worker 的信息。

参数

返回

List[WorkerInfo]

代码示例

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

>>> os.environ["PADDLE_WORKER_ENDPOINT"] = "127.0.0.1:9003"
>>> rpc.init_rpc("worker0", rank=0, world_size=1,
...         master_endpoint="127.0.0.1:8006")

>>> print(rpc.get_all_worker_infos())
[{name: worker0, rank: 0, ip: 127.0.0.1, port: 9003}]

>>> rpc.shutdown()