def node_rank(self) -> int:
        """The rank (index) of the host on which the current process runs.

        The output is cached for performance.

        """
        if _XLA_GREATER_EQUAL_2_1:
            from torch_xla import runtime as xr

            return xr.host_index()
        import torch_xla.core.xla_env_vars as xenv
        from torch_xla.utils.utils import getenv_as

        return getenv_as(xenv.HOST_ORDINAL, int, 0)
The rank (index) of the host on which the current process runs.

        The output is cached for performance.

        
src/lightning/fabric/plugins/environments/xla.py