def METHOD_NAME(require_mpi=False, log=True):
    """ Get whether MPI is enabled and if so the current size and rank
    """
    METHOD_NAME = False
    try:
        from mpi4py import MPI
        comm = MPI.COMM_WORLD
        size = comm.Get_size()
        rank = comm.Get_rank()
        if size > 1:
            METHOD_NAME = True
            if log:
                logging.info('Running under mpi with size: %s, rank: %s',
                             size, rank)
    except ImportError as e:
        if require_mpi:
            print(e)
            raise ValueError("Failed to load mpi, ensure mpi4py is installed")
    if not METHOD_NAME:
        size = rank = 0
    return METHOD_NAME, size, rank