def splitdata(N, nproc):
    """
    Creates splitters for dataset of length *N* for *nproc* processes.

    Splits to *nproc* equal data chunks.
    """
    n = N // nproc
    i = (nproc - N % nproc) * n
    idx = range(n, i, n) + range(i, N, n + 1)
    idx1 = [0] + idx
    idx2 = idx + [N]
    return zip(idx1, idx2)
