71 addParameter(superiorityPN_,
UINT,
false,
94 virtual std::vector<RowID>
96 std::vector<RowID> result;
109 debugLog(std::string(
"Fetching architecture from DSDB failed in "
113 result.push_back(configurationID);
126 bool estimate =
false;
127 if (!explorer.
evaluate(startConf, estimates, estimate)) {
128 debugLog(std::string(
"Evaluate failed in GrowMachine."));
129 result.push_back(configurationID);
135 debugLog(std::string(
"Error in GrowMachine: ")
138 result.push_back(configurationID);
144 std::vector<ClockCycleCount> cycleCounts =
145 db().cycleCounts(startConf);
148 if (cycleCounts.size() < 1) {
149 std::ostringstream msg(std::ostringstream::out);
150 msg <<
"GrowMachine error: Couldn't evaluate cycle "
151 <<
"counts for applications, correct_simulation_output"
152 <<
" probably missing." << std::endl;
154 result.push_back(configurationID);
162 for (
int i = 1; i < (int)cycleCounts.size(); i++) {
163 if (cycleCounts.at(i) < currentMinCycles) {
164 currentMinCycles = cycleCounts.at(i);
170 std::map<ClockCycleCount, RowID> resultMap;
172 prevMinCycles = currentMinCycles;
194 if (explorer.
evaluate(newConfiguration, newEstimates,
false)) {
196 std::vector<ClockCycleCount> newCycleCounts =
197 db().cycleCounts(newConfiguration);
199 currentMinCycles = newCycleCounts.at(0);
200 for (
int i = 1; i < (int)newCycleCounts.size(); i++) {
201 if (newCycleCounts.at(i) < currentMinCycles) {
202 currentMinCycles = newCycleCounts.at(i);
207 std::ostringstream msg(std::ostringstream::out);
208 msg <<
"GrowMachine produced config: "
209 << confID <<
", with cycle count: "
210 << currentMinCycles <<
" ("
211 << calculateImprovement(currentMinCycles,
217 if (checkSuperiority(currentMinCycles, prevMinCycles)) {
220 resultMap[currentMinCycles] = confID;
226 debugLog(
"GrowMachine: Evaluating config with id: "
228 +
" failed. This is probably a bug.");
233 debugLog(std::string(
"Error in GrowMachine: ")
236 result.push_back(configurationID);
243 std::map<ClockCycleCount, RowID>::const_iterator mapIter =
245 for (; mapIter != resultMap.end(); mapIter++) {
246 result.push_back((*mapIter).second);
248 if (result.empty()) {
250 verboseLogC(
"GrowMachine could not generate new configs.", 2)
251 result.push_back(configurationID);
272 readOptionalParameter(superiorityPN_, superiority_);
286 if ((newCC < oldCC) &&
287 (((
static_cast<double>(superiority_) / 100) * oldCC) <
304 return (1.0 -(
static_cast<double>(newCC)/oldCC))*100.0;