int sat = solver->solve();
long long metric = solver->getElapsedTime();
ofstream myfile;
- myfile.open (argv[4], ios::out);
- myfile << metric;
- myfile << sat;
+ myfile.open (argv[4], ios::out | ios::trunc);
+ myfile << metric << endl;
+ myfile << sat << endl;
myfile.close();
//serialize out the tuner we used
snprintf(buffer, sizeof(buffer), "%sused", argv[3]);
tuner->getTuner()->serialize(buffer);
//Do run
- snprintf(buffer, sizeof(buffer), "./run.sh deserializerun %s %u tuner%u result%s%u > log%u", problem->getProblem(), timeout, execnum, problem->getProblem(), execnum, execnum);
+ snprintf(buffer, sizeof(buffer), "./run.sh deserializerun %s %u tuner%u result%u > log%u", problem->getProblem(), timeout, execnum, execnum, execnum);
int status = system(buffer);
long long metric = -1;
if (status == 0) {
//Read data in from results file
- snprintf(buffer, sizeof(buffer), "result%s%u", problem->getProblem(), execnum);
+ snprintf(buffer, sizeof(buffer), "result%u", execnum);
ifstream myfile;
myfile.open (buffer, ios::in);
}
snprintf(buffer, sizeof(buffer), "tuner%uused", execnum);
- SearchTuner *usedtuner = new SearchTuner(buffer);
- delete tuner->getTuner();
- tuner->updateTuner(usedtuner);
-
+ tuner->getTuner()->addUsed(buffer);
}
//Increment execution count
execnum++;