System.out.println("Send credit: "+cc);
if (ClusterBackend.debugPrint) System.out.println("Send credit: "+cc);
    void combineInit() {        int node_id;        if (combine_ptr + 1 >= loop_start) return;        init();        System.out.println("-------------------------------------");        System.out.println("----------- COMBINING ---------------");        System.out.println("-------------------------------------");        for (int curr = 0; curr < combine_ptr; curr++) {            node_id = 0;            for (int y = 0; y < ph; y++) {                HashSet p = sched.getAllOperatorsInPhase(y);                Iterator it = p.iterator();                while (it.hasNext()) {                    SIROperator oper = (SIROperator)it.next();                    int id = NodeEnumerator.getSIROperatorId(oper);                    int exec = ((Integer)((Vector)phases.get(curr)).get(node_id)).intValue();                    int _iter = ((Integer)iteration.get(oper)).intValue();                    Vector in = RegisterStreams.getNodeInStreams(oper);                    Vector out = RegisterStreams.getNodeOutStreams(oper);                    for (int z = 0; z < in.size(); z++) {                        NetStream ns = (NetStream)in.get(z);                        SIROperator src = NodeEnumerator.getOperator(ns.getSource());                               int qsize = ((Integer)queue_size.get(makeVector(src, oper))).intValue();                        qsize -= getPop(oper, z) * exec;                        queue_size.put(makeVector(src, oper),                                        new Integer(qsize));                    }                                for (int z = 0; z < out.size(); z++) {                        NetStream ns = (NetStream)out.get(z);                        SIROperator dst = NodeEnumerator.getOperator(ns.getDest());                             int qsize = ((Integer)queue_size.get(makeVector(oper, dst))).intValue();                        qsize += getPush(oper, z) * exec;                        queue_size.put(makeVector(oper, dst),                                        new Integer(qsize));                    }                    for (int z = 0; z < exec; z++, _iter++) {                        if (!(oper instanceof SIRFilter)) continue;                                    HashSet cons = LatencyConstraints.getOutgoingConstraints((SIRFilter)oper);                        Iterator ci = cons.iterator();                        while (ci.hasNext()) {                                            //System.out.println("latency constraint");                                            LatencyConstraint c = (LatencyConstraint)ci.next();                            SIRFilter dst = (SIRFilter)c.getReceiver();                            boolean down = LatencyConstraints.isMessageDirectionDownstream((SIRFilter)oper, (SIRFilter)dst);                            int init_c = c.getSourceInit();                                            if (down) {                                                if (_iter >= init_c) {                                                        int s_steady = c.getSourceSteadyExec();                                    int cycle = (_iter - init_c) / s_steady;                                    int offs = (_iter - init_c) % s_steady;                                                        int dep = c.getDependencyData(offs);                                                        if (dep > 0) {                                        int cc = dep + cycle * c.getDestSteadyExec();                                        credit.put(dst, new Integer(cc));                                        System.out.println("Send credit: "+cc);                                    }                                }                                            } else {                                                int s_steady = c.getSourceSteadyExec();                                int cycle = _iter / s_steady;                                int offs = _iter % s_steady;                                                int dep = c.getDependencyData(offs);                                if (dep > 0) {                                    int cc = dep + cycle * c.getDestSteadyExec();                                    credit.put(dst, new Integer(cc));                                    System.out.println("Send credit: "+cc);                                }                            }                        }                    }                    iteration.put(oper, new Integer(_iter));                }                    }            }        boolean success = true;        node_id = 0;        Vector new_phase = new Vector();        for (int y = 0; y < ph; y++) {            HashSet p = sched.getAllOperatorsInPhase(y);            Iterator it = p.iterator();            while (it.hasNext()) {                SIROperator oper = (SIROperator)it.next();                int id = NodeEnumerator.getSIROperatorId(oper);                int steady_count = ((Integer)((Vector)phases.get(combine_ptr)).get(node_id)).intValue() +                    ((Integer)((Vector)phases.get(combine_ptr+1)).get(node_id)).intValue();                node_id++;                int _iter = ((Integer)iteration.get(oper)).intValue();                int _credit = ((Integer)credit.get(oper)).intValue();                int exec = steady_count;                if (_credit >= 0 && _iter + steady_count > _credit) {                    exec = _credit - _iter;                 }                int input = 2000000000;                Vector in = RegisterStreams.getNodeInStreams(oper);                Vector out = RegisterStreams.getNodeOutStreams(oper);                        for (int z = 0; z < in.size(); z++) {                    NetStream ns = (NetStream)in.get(z);                    SIROperator src = NodeEnumerator.getOperator(ns.getSource());                           int qsize = ((Integer)queue_size.get(makeVector(src, oper))).intValue();                    int peek = getPeek(oper, z);                    int pop = getPop(oper, z);                    if (peek < pop) peek = pop;                    int extra = peek - pop;                    int can = (qsize-extra)/pop;                    if (can < 0) can = 0;                    if (can < input) input = can;                }                if (input < exec) exec = input;                //System.out.println("CREDIT = "+_credit+" INPUT = "+input+" EXEC = "+exec);                        for (int z = 0; z < in.size(); z++) {                    NetStream ns = (NetStream)in.get(z);                    SIROperator src = NodeEnumerator.getOperator(ns.getSource());                           int qsize = ((Integer)queue_size.get(makeVector(src, oper))).intValue();                    qsize -= getPop(oper, z) * exec;                    queue_size.put(makeVector(src, oper),                                    new Integer(qsize));                }                for (int z = 0; z < out.size(); z++) {                    NetStream ns = (NetStream)out.get(z);                    SIROperator dst = NodeEnumerator.getOperator(ns.getDest());                         int qsize = ((Integer)queue_size.get(makeVector(oper, dst))).intValue();                    qsize += getPush(oper, z) * exec;                    queue_size.put(makeVector(oper, dst),                                    new Integer(qsize));                }                System.out.println(oper.getName()+" Exec = "+exec+"/"+steady_count);                if (exec < steady_count) success = false;                new_phase.add(new Integer(exec)); // push exec count to phase vector                for (int z = 0; z < exec; z++, _iter++) {                    if (!(oper instanceof SIRFilter)) continue;                                HashSet cons = LatencyConstraints.getOutgoingConstraints((SIRFilter)oper);                    Iterator ci = cons.iterator();                    while (ci.hasNext()) {                        //System.out.println("latency constraint");                        LatencyConstraint c = (LatencyConstraint)ci.next();                        SIRFilter dst = (SIRFilter)c.getReceiver();                        boolean down = LatencyConstraints.isMessageDirectionDownstream((SIRFilter)oper, (SIRFilter)dst);                        int init_c = c.getSourceInit();                                    if (down) {                                            if (_iter >= init_c) {                                                int s_steady = c.getSourceSteadyExec();                                int cycle = (_iter - init_c) / s_steady;                                int offs = (_iter - init_c) % s_steady;                                                int dep = c.getDependencyData(offs);                                //System.out.println("dep = "+dep);                                //System.out.println("c = "+cycle);                                //System.out.println("o = "+offs);                                if (dep > 0) {                                    int cc = dep + cycle * c.getDestSteadyExec();                                    credit.put(dst, new Integer(cc));                                    System.out.println("Send credit: "+cc);                                }                            }                                        } else {                                            int s_steady = c.getSourceSteadyExec();                            int cycle = _iter / s_steady;                            int offs = _iter % s_steady;                                            int dep = c.getDependencyData(offs);                            if (dep > 0) {                                int cc = dep + cycle * c.getDestSteadyExec();                                credit.put(dst, new Integer(cc));                                System.out.println("Send credit: "+cc);                            }                        }                    }                }                iteration.put(oper, new Integer(_iter));            }        }            System.out.println(success?"SUCCESS":"FAILED");        if (success) {            phases.set(combine_ptr, new_phase);            phases.remove(combine_ptr+1);            loop_start--;        } else {            combine_ptr++;        }    }