def mpi_enabled(self):
        """
        Returns:
            bool: whether hvd is currently running under MPI
        """
        try:
            return self.hvd.mpi_enabled()
        except AttributeError:
            return False

        Returns:
            bool: whether hvd is currently running under MPI
        
tensorpack/train/trainers.py