mindspore.mint.distributed.is_initialized

View Source On Gitee
mindspore.mint.distributed.is_initialized()[source]

Checks if default process group has been initialized.

Returns

bool, whether the default process group has been initialized.

Supported Platforms:

Ascend

Examples

Note

Before running the following examples, you need to configure the communication environment variables.

For Ascend devices, it is recommended to use the msrun startup method without any third-party or configuration file dependencies. Please see the msrun start up for more details.

>>> import mindspore as ms
>>> from mindspore.mint.distributed import init_process_group, is_initialized
>>> ms.set_device(device_target="Ascend")
>>> init_process_group()
>>> is_initialized()