Beispiel #1
0
 private void beginInvokeBenchmarkStatisticsCollectionAdd(BenchmarkStatisticsCollection benchmarkStatisticsCollection, BenchmarkStatisticsResult benchmarkStatisticsResult)
 {
     this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(
                                     delegate()
     {
         benchmarkStatisticsCollection.addSorted(benchmarkStatisticsResult);
     }
                                     ));
 }
Beispiel #2
0
        private void simulate_Click(object sender, RoutedEventArgs e)
        {
            List <PredictorInfo> predictorRequests;

            if (!this.AppOptions.IsPredictorCompareMode)
            {
                PredictorTypeInfo predictorType = (PredictorTypeInfo)PredictorTypesListBox.SelectedItem;
                predictorRequests = getPredictorRequests(predictorType);
            }
            else
            {
                predictorRequests = new List <PredictorInfo>();
                foreach (PredictorTypeInfo predictorTypeInfo in predictorTypeList)
                {
                    if (predictorTypeInfo.IsChecked)
                    {
                        predictorRequests.AddRange(getPredictorRequests(predictorTypeInfo));
                    }
                }
            }

            // Stanford
            var stanfordTraceQuery = from trace in stanfordTraces
                                     where trace.Selected
                                     select trace.Filename;

            // SPEC2000
            var spec2000TraceQuery = from trace in spec2000Traces
                                     where trace.Selected
                                     select trace.Filename;

            // CBP 2
            var CBP2TraceQuery = from trace in cbp2Traces
                                 where trace.Selected
                                 select trace.Filename;

            int numberOfSelectedTraces = stanfordTraceQuery.Count() + spec2000TraceQuery.Count() + CBP2TraceQuery.Count();

            if (numberOfSelectedTraces == 0)
            {
                displayedResults.Add(new ResultListMessage("(no traces selected)"));
                return;
            }
            if (predictorRequests.Count == 0)
            {
                displayedResults.Add(new ResultListMessage("(no predictors selected)"));
                return;
            }

            // start the simulation

            simulationResultsDictionary.Clear();
            simulationQueue.Clear();

            foreach (string traceFilename in stanfordTraceQuery)
            {
                simulationResultsDictionary.addBenchmark(new BenchmarkInfo(traceFilename, BenchmarkType.Stanford));
            }
            foreach (string traceFilename in spec2000TraceQuery)
            {
                simulationResultsDictionary.addBenchmark(new BenchmarkInfo(traceFilename, BenchmarkType.SPEC2000));
            }
            foreach (string traceFilename in CBP2TraceQuery)
            {
                simulationResultsDictionary.addBenchmark(new BenchmarkInfo(traceFilename, BenchmarkType.CBP2));
            }

            foreach (PredictorInfo predictorRequest in predictorRequests)
            {
                foreach (BenchmarkInfo benchmarkInfo in simulationResultsDictionary.Benchmarks)
                {
                    simulationQueue.Enqueue(new SimulationInfo(predictorRequest, benchmarkInfo));
                }
            }

            displayedResults.Add(new ResultListMessage("Starting " + simulationQueue.Count + " simulations on " + predictorRequests.Count + " predictor versions"));

            foreach (PredictorInfo predictorInfo in predictorRequests)
            {
                BenchmarkStatisticsCollection benchmarkStatisticsCollection = simulationResultsDictionary.addPredictor(predictorInfo);

                displayedResults.Add(new ResultListMessage("Simulation using " + predictorInfo.description));
                displayedResults.Add(benchmarkStatisticsCollection);
            }

            simulationResultsDictionary.initialize();

            // start worker threads
            this.startWork();
        }