def METHOD_NAME(sendbuf, root=0, op=getattr(mpi, 'SUM', None)):
    if size == 1:
        return sendbuf
    is_array = isinstance(sendbuf, np.ndarray)
    sendbuf = np.asarray(sendbuf, order='C')
    sendbuf = sendbuf.astype(sendbuf.dtype.char)
    shape, mpi_dtype = comm.bcast((sendbuf.shape, sendbuf.dtype.char))
    assert sendbuf.shape == shape and sendbuf.dtype.char == mpi_dtype
    recvbuf = np.zeros_like(sendbuf)
    send_seg = np.ndarray(sendbuf.size, dtype=sendbuf.dtype, buffer=sendbuf)
    recv_seg = np.ndarray(recvbuf.size, dtype=recvbuf.dtype, buffer=recvbuf)
    for p0, p1 in lib.prange(0, sendbuf.size, BLKSIZE):
        comm.Allreduce(send_seg[p0:p1], recv_seg[p0:p1], op)
    return recvbuf if is_array else recvbuf.ravel()[0]