...
 
Commits (3)
......@@ -63,6 +63,10 @@ double IndepDP2::tryGuess(Instance& instance, std::vector<int> taskSet, vector<d
const double exec1 = instance.execTimes[1][taskType];
totalCPULoad += (1-affect[i])*exec0;
totalGPULoad += affect[i]*(cplexUseDiscretizedValues ? discreteGPUtimings[taskType] : exec1);
if(exec0 > maxlen)
model.add(affect[i] == 1);
if(exec1 > maxlen)
model.add(affect[i] == 0);
}
if(cplexUseDiscretizedValues)
......@@ -74,7 +78,7 @@ double IndepDP2::tryGuess(Instance& instance, std::vector<int> taskSet, vector<d
IloCplex modelCplex = IloCplex(model);
if(verbosity < 8)
modelCplex.setOut(env.getNullStream());
modelCplex.setParam(IloCplex::Param::MIP::Tolerances::MIPGap, 0.000001);
modelCplex.setParam(IloCplex::Param::MIP::Tolerances::MIPGap, 0.0000001);
IloBool feasible = modelCplex.solve();
......@@ -127,8 +131,11 @@ double IndepDP2::tryGuess(Instance& instance, std::vector<int> taskSet, vector<d
// Possible optimization if needed: run this test for all
// taskTypes (which appear in the taskSet) instead of for all
// tasks
if(exec0 > maxlen && exec1 > maxlen)
if(exec0 > maxlen && exec1 > maxlen){
delete[] CPUload[0];
delete[] CPUload;
return -1; // Problem is not feasible: task t cannot be placed on any resource
}
if((exec0 <= maxlen) && (exec1 <= maxlen)) {
for(int l = N; l >= discreteGPUtime; --l) {
CPUload[nextIndex][l] = min(CPUload[index][l] + exec0, CPUload[index][l - discreteGPUtime]);
......
......@@ -78,6 +78,10 @@ double IndepDP3Demi::tryGuess(Instance& instance, std::vector<int> taskSet, vect
nbTasksWithLargeGPUTime += affect[i];
totalCPULoad += (1-affect[i])*exec0;
totalGPULoad += affect[i]*(cplexUseDiscretizedValues ? discreteGPUtimings[taskType] : exec1);
if(exec0 > target)
model.add(affect[i] == 1);
if(exec1 > target)
model.add(affect[i] == 0);
}
model.add(nbTasksWithLargeCPUTime <= nbCPU);
......@@ -160,8 +164,11 @@ double IndepDP3Demi::tryGuess(Instance& instance, std::vector<int> taskSet, vect
const int muOffset = isLongOnCPU[taskType];
const int nuOffset = isLongOnGPU[taskType];
if(exec0 > target && exec1 > target)
if(exec0 > target && exec1 > target) {
delete[] CPUload[0];
delete[] CPUload;
return -1; // Problem is not feasible: task t cannot be placed on any resource
}
if(verbosity >= 8)
cout << "Task " << t << " dGPUTime="<< discreteGPUtime << " exec0=" << exec0 << " muOffset="<<muOffset << " nuOffset="<<nuOffset << endl;
......