Commit fb58125b authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

IndepAccel: Stop iterating if nothing changes

parent 5aa2e95c
......@@ -106,18 +106,23 @@ bool IndepAccel::tryGuess(Instance& ins, std::vector<int> taskSet, double target
cout << " G1: " << setG1 << endl;
cout << " G2: " << setG2 << endl;
}
bool changed = false;
while ((GPUload <= nbGPU * target) && (iterC2 != setC2.end())) {
setG2.push_back(*iterC2);
GPUload += gpuTime(ins, *iterC2);
CPUload -= cpuTime(ins, *iterC2);
iterC2++;
iterC2++;
changed = true;
}
if( (((int) setC1.size()) < nbCPU) && (iterG1 != setG1.end()) && (cpuTime(ins, *iterG1) <= target) ) {
setC1.push_back(*iterG1);
GPUload -= gpuTime(ins, *iterG1);
CPUload += cpuTime(ins, *iterG1);
iterG1++;
iterG1++;
changed = true;
}
if(!changed)
break;
iterations++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment