Skip to content

is_distributed_environment

kedro_azureml_pipeline.distributed.is_distributed_environment()

Check whether the process is running in a distributed context.

Returns

Type Description
bool

True if any distributed rank variable is set.

See Also

is_distributed_master_node : Checks master rank. DistributedNodeConfig : Per-node distributed config.

Source Code

Show/Hide source
def is_distributed_environment() -> bool:
    """Check whether the process is running in a distributed context.

    Returns
    -------
    bool
        ``True`` if any distributed rank variable is set.

    See Also
    --------
    [is_distributed_master_node][kedro_azureml_pipeline.distributed.utils.is_distributed_master_node] : Checks master rank.
    [DistributedNodeConfig][kedro_azureml_pipeline.distributed.config.DistributedNodeConfig] : Per-node distributed config.
    """
    return any(e in os.environ for e in ("OMPI_COMM_WORLD_RANK", "RANK", "TF_CONFIG"))