class_docstr: Cluster environment for training on a TPU Pod with the `PyTorch/XLA <https://pytorch.org/xla>`_ library.
  
  A list of environment variables set by XLA can be found
  `here <https://github.com/pytorch/xla/blob/master/torch_xla/core/xla_env_vars.py>`_.
class_docstr_tok: ["Cluster","environment","for","training","on","a","TPU","Pod","with","the","`","PyTorch\/XLA","<","https",":","\/\/pytorch.org\/xla",">","`","_","library",".","A","list","of","environment","variables","set","by","XLA","can","be","found","`","here","<","https",":","\/\/github.com\/pytorch\/xla\/blob\/master\/torch_xla\/core\/xla_env_vars.py",">","`","_","."]
docstr: The rank (index) of the host on which the current process runs.
  
  The output is cached for performance.
docstr_tok: ["The","rank","(","index",")","of","the","host","on","which","the","current","process","runs",".","The","output","is","cached","for","performance","."]
code: 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)
  
file_path: pytorch-lightning/src/lightning/fabric/plugins/environments/xla.py
imports: import functools
  import logging
  from typing import Any
  from typing_extensions import override
  from lightning.fabric.accelerators.xla import _XLA_AVAILABLE, _XLA_GREATER_EQUAL_2_1, XLAAccelerator
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
label_desc: Use image node_id 11 for calling the XLAEnvironment obj's underlying member method code with example usage: obj.node_rank() and returns: getenv_as, xr