def METHOD_NAME(x, *, comm=MPI_py_comm):
    """
    Computes the elementwise logical AND of an array or a scalar across all MPI
    processes.
    Args:
        a: The input array, which will usually be overwritten in place.
    Returns:
        out: The reduced array.
    """
    ar = np.asarray(x)
    if n_nodes > 1:
        comm.Allreduce(MPI.IN_PLACE, ar.reshape(-1), op=MPI.LAND)
    return ar