computeMinLatencySchedule(
int extraExecs = computeMinLatencySchedule(
    public void computeSchedule()    {        int steadyChildPhases[] = new int[getNumChildren()];        // first compute schedules for all my children        {            int nChild;            for (nChild = 0; nChild < getNumChildren(); nChild++)            {                StreamInterface child = getHierarchicalChild(nChild);                // compute child's schedule                child.computeSchedule();                // get the # of phases that this child needs to have executed                // to complete a steady state schedule                steadyChildPhases[nChild] =                    child.getNumSteadyPhases() * getChildNumExecs(nChild);            }        }        int dataInBuffers[] = new int[getNumChildren() + 1];        // first compute an initialization schedule        {            // figure out how many phases each child needs to execute            int childInitStages[] = new int[getNumChildren()];            for (int nChild = 0; nChild < getNumChildren(); nChild++)            {                StreamInterface child = getHierarchicalChild(nChild);                childInitStages[nChild] = child.getNumInitStages();            }            // also check that all children will feed their            // downstream siblings enough data to execute their             // steady state            for (int nChild = 0; nChild < getNumChildren() - 1; nChild++)            {                StreamInterface child = getHierarchicalChild(nChild);                int dataNeeded =                    getHierarchicalChild(nChild + 1).getSteadyPeek();                int dataPushed = 0;                int nStages;                for (nStages = 0;                    dataNeeded > dataPushed;                    nStages++)                {                    dataPushed                        += getChildInitStage(child, nStages).getOverallPush();                }                childInitStages[nChild] = MAX(childInitStages[nChild], nStages);            }            // and create a schedule that will execute enough stages            computeMinLatencySchedule(                new PipelineInitSchedulingUtility(this),                childInitStages,                dataInBuffers,                childInitStages[getNumChildren() - 1]);        }        // now compute a steady state schedule        {            // figure out how many phases each child needs to execute            int numChildPhases[] = new int[getNumChildren()];            for (int nChild = 0; nChild < getNumChildren(); nChild++)            {                numChildPhases[nChild] =                    getChildNumExecs(nChild)                        * getHierarchicalChild(nChild).getNumSteadyPhases();            }            // figure out how many times I want to run the last child            int lastChildNumExecPerPhase;            {                if (getHierarchicalChild(getNumChildren() - 1).getSteadyPush()                    != 0)                {                    // the last child is not a sink                    // execute it to the heart's content                    lastChildNumExecPerPhase =                        numChildPhases[getNumChildren() - 1];                }                else                {                    // the last child is a sink! use the algorithm described                    // in karczma's thesis (page 87) to figure out how many                    // phases of the pipeline I want                    int numDataConsumed =                        getChildNumExecs(getNumChildren() - 1)                            * getHierarchicalChild(getNumChildren() - 1)                                .getSteadyPop();                    double numPipelinePhases = Math.sqrt(numDataConsumed);                    if (numPipelinePhases != 0)                        lastChildNumExecPerPhase =                            (int)Math.ceil(                                ((double)numChildPhases[getNumChildren() - 1])                                    / numPipelinePhases);                    else                        lastChildNumExecPerPhase =                            numChildPhases[getNumChildren() - 1];                }            }            computeMinLatencySchedule(                new PipelineSteadySchedulingUtility(this),                numChildPhases,                dataInBuffers,                lastChildNumExecPerPhase);        }    }