updateTimeout(problem, metric);
snprintf(buffer, sizeof(buffer), "tuner%uused", execnum);
tuner->getTuner()->addUsed(buffer);
+ } else if (status == 124 << 8){ // timeout happens ...
+ tuner->getTuner()->copySettingstoUsedSettings();
}
+
//Increment execution count
execnum++;
SearchTuner *SearchTuner::copyUsed() {
SearchTuner *tuner = new SearchTuner();
-
- SetIteratorTunableSetting *iterator = !usedSettings.isEmpty()? usedSettings.iterator():settings.iterator();
+ SetIteratorTunableSetting *iterator = usedSettings.iterator();
while (iterator->hasNext()) {
TunableSetting *setting = iterator->next();
TunableSetting *copy = new TunableSetting(setting);
return tuner;
}
+void SearchTuner::copySettingstoUsedSettings() {
+ SetIteratorTunableSetting *iterator = settings.iterator();
+ while (iterator->hasNext()) {
+ TunableSetting *setting = iterator->next();
+ TunableSetting *copy = new TunableSetting(setting);
+ usedSettings.add(copy);
+ }
+ delete iterator;
+}
+
SearchTuner::~SearchTuner() {
SetIteratorTunableSetting *iterator = settings.iterator();
while (iterator->hasNext()) {
void setVarTunable(VarType vartype, TunableParam param, TunableDesc *descriptor, uint value);
void setVarTunable(VarType vartype1, VarType vartype2, TunableParam param, TunableDesc *descriptor, uint value);
SearchTuner *copyUsed();
+ void copySettingstoUsedSettings();
bool isSubTunerof(SearchTuner *newTuner);
void randomMutate();
uint getSize() { return usedSettings.getSize();}