Merge branch 'tuner' of ssh://plrg.eecs.uci.edu/home/git/constraint_compiler into...
authorbdemsky <bdemsky@uci.edu>
Wed, 17 Oct 2018 21:50:25 +0000 (14:50 -0700)
committerbdemsky <bdemsky@uci.edu>
Wed, 17 Oct 2018 21:50:25 +0000 (14:50 -0700)
1  2 
src/Tuner/multituner.cc

diff --combined src/Tuner/multituner.cc
@@@ -217,7 -217,6 +217,7 @@@ void MultiTuner::tuneComp() 
                        SearchTuner *tmpTuner = mutateTuner(tunerV->get(i)->getTuner(), b);
                        TunerRecord *tmp = new TunerRecord(tmpTuner);
                        tmp->tunernumber = allTuners.getSize();
 +                      model_print("Mutated tuner %u to generate tuner %u\n", tunerV->get(i)->tunernumber, tmp->tunernumber);
                        allTuners.push(tmp);
                        tunerV->push(tmp);
                }
                                long long metric = tuner->getTime(problem);
                                if (metric == -1) {
                                        metric = evaluate(problem, tuner);
-                                       if (tuner->getTime(problem) == -1)
+                                       if (tuner->getTime(problem) == -1){
                                                tuner->problems.push(problem);
+                                       }
+                                       DEBUG("%u.Problem<%s>\tTuner<%p>\tMetric<%lld>\n", i, problem->problem,tuner, metric);
+                                       DEBUG("*****************************\n");
                                        if (metric != -1)
                                                tuner->setTime(problem, metric);
                                }
                                                if (metric < places.get(k)->getTime(problem))
                                                        break;
                                        }
+                                       DEBUG("place[%u]=Tuner<%p>\n", k, tuner);
                                        places.insertAt(k, tuner);
                                }
                        }
                        int points = 9;
                        for (uint k = 0; k < places.getSize() && points; k++) {
                                TunerRecord *tuner = places.get(k);
-                               points = points / 3;
                                int currScore = 0;
                                if (scores.contains(tuner))
                                        currScore = scores.get(tuner);
                                currScore += points;
+                               DEBUG("Problem<%s>\tTuner<%p>\tmetric<%d>\n", problem->problem, tuner, currScore);
+                               DEBUG("**************************\n");
                                scores.put(tuner, currScore);
+                               points = points / 3;
                        }
                }
                Vector<TunerRecord *> ranking;
                                if (score < tscore)
                                        break;
                        }
+                       DEBUG("ranking[%u]=tuner<%p>(Score=%d)\n", j, tuner, score);
+                       DEBUG("************************\n");
                        ranking.insertAt(j, tuner);
                }
+               DEBUG("tunerSize=%u\trankingSize=%u\ttunerVSize=%u\n", tuners.getSize(), ranking.getSize(), tunerV->getSize());
                for (uint i = tuners.getSize(); i < ranking.getSize(); i++) {
                        TunerRecord *tuner = ranking.get(i);
                        for (uint j = 0; j < tunerV->getSize(); j++) {
 +                              model_print("Removing tuner %u\n", tuner->tunernumber);
                                if (tunerV->get(j) == tuner)
                                        tunerV->removeAt(j);
                        }