def lower_schedule(cluster, schedule, sregistry, options):
    '\n    Turn a Schedule into a sequence of Clusters.\n    '
    ftemps = options['cire-ftemps']
    if ftemps:
        make = TempFunction
    else:
        make = Array
    clusters = []
    subs = {}
    for (alias, writeto, ispace, aliaseds, indicess) in schedule:
        name = sregistry.make_name()
        dtype = cluster.dtype
        if writeto:
            dimensions = [(d.parent if d.is_Sub else d) for d in writeto.itdimensions]
            halo = [(abs(i.lower), abs(i.upper)) for i in writeto]
            indices = []
            for i in writeto:
                try:
                    sub_iterators = writeto.sub_iterators[i.dim]
                    assert (len(sub_iterators) == 1)
                    indices.append(sub_iterators[0])
                except KeyError:
                    indices.append((i.dim - i.lower))
            obj = make(name=name, dimensions=dimensions, halo=halo, dtype=dtype)
            expression = Eq(obj[indices], alias)
            callback = (lambda idx: obj[idx])
        else:
            assert (writeto.size == 0)
            obj = Symbol(name=name, dtype=dtype)
            expression = Eq(obj, alias)
            callback = (lambda idx: obj)
        subs.update({aliased: callback(indices) for (aliased, indices) in zip(aliaseds, indicess)})
        accesses = detect_accesses(expression)
        parts = {k: IntervalGroup(build_intervals(v)).add(ispace.intervals).relaxed for (k, v) in accesses.items() if k}
        dspace = DataSpace(cluster.dspace.intervals, parts)
        properties = dict(cluster.properties)
        for (d, v) in cluster.properties.items():
            if any((i.is_Modulo for i in ispace.sub_iterators[d])):
                properties[d] = normalize_properties(v, {SEQUENTIAL})
            elif (d not in writeto.dimensions):
                properties[d] = normalize_properties(v, {PARALLEL_IF_PVT})
        clusters.append(cluster.rebuild(exprs=expression, ispace=ispace, dspace=dspace, properties=properties))
    return (clusters, subs)
Turn a Schedule into a sequence of Clusters.
def lower_schedule(cluster, schedule, sregistry, options):
    '\n    \n    '
    ftemps = options['cire-ftemps']
    if ftemps:
        make = TempFunction
    else:
        make = Array
    clusters = []
    subs = {}
    for (alias, writeto, ispace, aliaseds, indicess) in schedule:
        name = sregistry.make_name()
        dtype = cluster.dtype
        if writeto:
            dimensions = [(d.parent if d.is_Sub else d) for d in writeto.itdimensions]
            halo = [(abs(i.lower), abs(i.upper)) for i in writeto]
            indices = []
            for i in writeto:
                try:
                    sub_iterators = writeto.sub_iterators[i.dim]
                    assert (len(sub_iterators) == 1)
                    indices.append(sub_iterators[0])
                except KeyError:
                    indices.append((i.dim - i.lower))
            obj = make(name=name, dimensions=dimensions, halo=halo, dtype=dtype)
            expression = Eq(obj[indices], alias)
            callback = (lambda idx: obj[idx])
        else:
            assert (writeto.size == 0)
            obj = Symbol(name=name, dtype=dtype)
            expression = Eq(obj, alias)
            callback = (lambda idx: obj)
        subs.update({aliased: callback(indices) for (aliased, indices) in zip(aliaseds, indicess)})
        accesses = detect_accesses(expression)
        parts = {k: IntervalGroup(build_intervals(v)).add(ispace.intervals).relaxed for (k, v) in accesses.items() if k}
        dspace = DataSpace(cluster.dspace.intervals, parts)
        properties = dict(cluster.properties)
        for (d, v) in cluster.properties.items():
            if any((i.is_Modulo for i in ispace.sub_iterators[d])):
                properties[d] = normalize_properties(v, {SEQUENTIAL})
            elif (d not in writeto.dimensions):
                properties[d] = normalize_properties(v, {PARALLEL_IF_PVT})
        clusters.append(cluster.rebuild(exprs=expression, ispace=ispace, dspace=dspace, properties=properties))
    return (clusters, subs)