def pre(rank, chunk):
    return cases(chunk, (lambda c: (rank == (c % local_nodes))), (lambda c: (rank == ((c // (num_copies - 1)) % local_nodes))), (lambda c: (rank == remote_node)))
def pre(rank, chunk):
    return cases(chunk, (lambda c: (rank == (c % local_nodes))), (lambda c: (rank == ((c // (num_copies - 1)) % local_nodes))), (lambda c: (rank == remote_node)))