def dist_uniform(nwork, workers, id=None):
    """
    Statically distribute some number of items among workers.

    This assumes that each item has equal weight, and that they
    should be divided into contiguous blocks of items and
    assigned to workers in rank order.

    This function returns the index of the first item and the
    number of items for the specified worker ID, or the information
    for all workers.

    Args:
        nwork (int): the number of things to distribute.
        workers (int): the number of workers.
        id (int): optionally return just the tuple associated with
            this worker

    Returns (tuple):
        A tuple of ints, containing the first item and number
        of items.  If id=None, then return a list containing the tuple
        for all workers.

    """
    dist = []

    for i in range(workers):
        ntask = nwork // workers
        firsttask = 0
        leftover = nwork % workers
        if i < leftover:
            ntask += 1
            firsttask = i * ntask
        else:
            firsttask = ((ntask + 1) * leftover) + (ntask * (i - leftover))
        dist.append( (firsttask, ntask) )

    if id is not None:
        if id < len(dist):
            return dist[id]
        else:
            raise RuntimeError("worker ID is out of range")
    else:
        return dist