Commit 1c76232c authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

New ranking scheme 'unit', which assigns weight one to each task and computes bottom levels.

parent 4c8b7027
......@@ -189,7 +189,7 @@ by previously scheduled tasks.
tasks are ordered in the same order as they become ready
- `none`
use the order in which tasks are given in the input file
- `min`, `heft`, `area`
- `min`, `heft`, `area`, `unit`
orders based on the task graph: priorities are equal to bottom
levels of tasks according to a specific task weight:
+ `min`: smallest execution time accross all ressources
......@@ -197,6 +197,7 @@ by previously scheduled tasks.
+ `area`: average execution time accross all ressources
weighted by the proportion in the area bound for that task
type.
+ `unit`: each task has weight 1.
- `ext@FILE`
Use external priorities from a file (all values in order
in which the tasks are given in the instance file)
......
......@@ -363,6 +363,15 @@ vector<double> Instance::computeMinRank() {
return rank;
}
std::vector<double> Instance::computeUnitRank() {
vector<double> wbar(nbTasks, 1);
vector<double> rank = computeRanks(wbar);
wbar.clear();
return rank;
}
vector<double> Instance::computePreAllocRank(vector<int> alloc) {
vector<double> wbar(nbTasks, 0);
......
......@@ -77,6 +77,7 @@ public:
std::vector<double> computeRanks(std::vector<double> wbar, int to = -1, int from = -1);
std::vector<double> computeHEFTRank();
std::vector<double> computeMinRank();
std::vector<double> computeUnitRank();
std::vector<double> computePreAllocRank(std::vector<int> alloc);
std::vector<double> computeLongestPath(const std::vector<double> &weights, bool display=false, std::vector<int>* storeCP=NULL, int to = -1, int from = -1);
std::vector<double> computeCriticalPath(bool display, std::vector<int>* storeCP);
......
......@@ -16,6 +16,8 @@
#ifdef WITH_CPLEX
#include <AreaRound.h>
#include <IndepCLB2C.h>
#endif
using namespace std;
......@@ -43,6 +45,8 @@ IndepBased::IndepBased(const AlgOptions& options) : GreedyAlgorithm(options) {
indep = new IndepBalancedMkspan(options);
if(indepName == "zhang")
indep = new IndepZhang(options);
if(indepName == "clb2c")
indep = new IndepCLB2C(options);
#ifdef WITH_CPLEX
if(indepName == "round")
indep = new AreaRound(options);
......@@ -92,13 +96,17 @@ void IndepBased::allocate(double now) {
}
if(verbosity >= 1) {
cout << "Indep2: allocating " << now << endl;
cout << "Indep: allocating at time " << now << endl;
if(verbosity >= 3)
cout << "Indep: calling with TS=" << unassignedTasks << " and loads=" << scheduledLoad << endl;
}
IndepResult result = indep->compute(*ins, unassignedTasks, scheduledLoad);
IndepResult result = indep->compute(*ins, unassignedTasks, scheduledLoad);
if(verbosity >= 3)
cout << "Result of Allocation: " << result << endl;
for(int i = 0; i < ins->nbWorkerTypes; i++) {
allocated[i].swap(result[i]);
}
unassignedTasks.clear();
hasChanged = false;
}
......
......@@ -26,7 +26,9 @@ intCompare* RankComputer::oneCmp(Instance& ins, string subRankOpt) {
if(subRankOpt == "heft")
w = ins.computeHEFTRank();
else if(subRankOpt == "min")
w = ins.computeMinRank();
w = ins.computeMinRank();
else if(subRankOpt == "unit")
w = ins.computeUnitRank();
#ifdef WITH_CPLEX
else if(subRankOpt == "area") {
vector<vector<double> >* repartition;
......
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