class_docstr: An environment for running on clusters with processes created through MPI.
  
  Requires the installation of the `mpi4py` package. See also: https://github.com/mpi4py/mpi4py
code: def __init__(self) -> None:
      if not _MPI4PY_AVAILABLE:
          raise ModuleNotFoundError(str(_MPI4PY_AVAILABLE))
  
      from mpi4py import MPI
  
      self._comm_world = MPI.COMM_WORLD
      self._comm_local: Optional[MPI.Comm] = None
      self._node_rank: Optional[int] = None
      self._main_address: Optional[str] = None
      self._main_port: Optional[int] = None
  
imports: import logging
  import socket
  from functools import lru_cache
  from typing import Optional
  from lightning_utilities.core.imports import RequirementCache
  from typing_extensions import override
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
  from lightning.fabric.plugins.environments.lightning import find_free_network_port
label_desc: Use image node_id 1 to create a new MPIEnvironment object from inherited base classes: ClusterEnvironment with example: obj = MPIEnvironment()