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_comm_local(self) -> None:
      hostname = socket.gethostname()
      all_hostnames = self._comm_world.gather(
          hostname, root=0
      )  # returns None on non-root ranks
      # sort all the hostnames, and find unique ones
      unique_hosts = (
          sorted(set(all_hostnames))
          if all_hostnames is not None
          else []
      )
      unique_hosts = self._comm_world.bcast(unique_hosts, root=0)
      # find the index for this host in the list of hosts:
      self._node_rank = unique_hosts.index(hostname)
      self._comm_local = self._comm_world.Split(color=self._node_rank)
  
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 14 for calling the MPIEnvironment obj's underlying member method code with example usage: obj._init_comm_local() without return types