"""Dummy MPI environment when interface_mpi.*so is not found."""

import numpy as np


def mpienv_init() -> None:
    """
    Initialize MPI environment. Should be called on import.
    :return: None
    """
    pass


def mpienv_finalize() -> None:
    """
    Finalize MPI environment. Should be called on exit.
    :return: None
    """
    pass


class CPPBaseMPIEnv:
    @staticmethod
    def get_rank() -> int:
        return 0

    @staticmethod
    def get_size() -> int:
        return 1

    @staticmethod
    def is_master() -> bool:
        return True

    @staticmethod
    def is_mpi_enabled() -> bool:
        return False

    @staticmethod
    def bcast_double(data_local: np.ndarray) -> None:
        pass

    @staticmethod
    def bcast_complex(data_local: np.ndarray) -> None:
        pass

    @staticmethod
    def barrier() -> None:
        pass
