Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 5f5653e4 authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

New Indep algorithm: MinMin, based on doi:10.1006/jpdc.2000.1714

parent f1666db4
...@@ -330,6 +330,9 @@ resources. All of these only work with two types of resources. ...@@ -330,6 +330,9 @@ resources. All of these only work with two types of resources.
Implements the CLB2C strategy (see [Considerations on distributed load balancing for fully heterogeneous machines: Two particular cases.](https://doi.org/10.1109/IPDPSW.2015.36)). Implements the CLB2C strategy (see [Considerations on distributed load balancing for fully heterogeneous machines: Two particular cases.](https://doi.org/10.1109/IPDPSW.2015.36)).
Not exactly equivalent to this strategy, since `indep` performs list scheduling based only on the Not exactly equivalent to this strategy, since `indep` performs list scheduling based only on the
assignment to different types of resources. assignment to different types of resources.
+ `minmin`
Implements the MinMin strategy (see [A Comparison of Eleven Static Heuristics for Mapping a Class of Independent Tasks onto Heterogeneous Distributed Computing Systems](https://doi.org/10.1006/jpdc.2000.1714).)
+ `rank` (except for style `strict`) + `rank` (except for style `strict`)
as for the previous algorithms as for the previous algorithms
+ `dosort` (except for `strict`, default `yes`) + `dosort` (except for `strict`, default `yes`)
......
//
// Created by eyraud on 25/03/19.
// Based on A Comparison of Eleven Static Heuristics for
// Mapping a Class of Independent Tasks onto
// Heterogeneous Distributed Computing Systems
// doi:10.1006/jpdc.2000.1714
#ifndef PMTOOL_MINMIN_H
#define PMTOOL_MINMIN_H
#include "IndepAllocator.h"
class IndepMinMin : public IndepAllocator {
private:
Instance* ins;
std::vector<int> workerIndices;
std::vector<int> bestWorkers; /* length = nb worker types */
int getEarliestWorker(std::vector<double> &loads, int type);
inline double endTime(std::vector<double> &loads, int workerType, int task);
public:
IndepResult compute(Instance &ins, std::vector<int> &taskSet, std::vector<double> &loads) override;
IndepMinMin(const AlgOptions &options);
};
#endif //PMTOOL_MINMIN_H
...@@ -27,7 +27,7 @@ set(SCHED_SRC ...@@ -27,7 +27,7 @@ set(SCHED_SRC
OnlineLG.cpp ../include/OnlineLG.h OnlineLG.cpp ../include/OnlineLG.h
OnlineMG.cpp ../include/OnlineMG.h OnlineMG.cpp ../include/OnlineMG.h
IndepCLB2C.cpp ../include/IndepCLB2C.h IndepCLB2C.cpp ../include/IndepCLB2C.h
IndepMinMin.cpp ../include/IndepMinMin.h
) )
if(CPLEX_FOUND) if(CPLEX_FOUND)
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "IndepBalanced.h" #include "IndepBalanced.h"
#include "IndepZhang.h" #include "IndepZhang.h"
#include <IndepCLB2C.h> #include <IndepCLB2C.h>
#include <IndepMinMin.h>
#include <vector> #include <vector>
#include <set> #include <set>
...@@ -49,6 +50,8 @@ IndepBased::IndepBased(const AlgOptions& options) : GreedyAlgorithm(options) { ...@@ -49,6 +50,8 @@ IndepBased::IndepBased(const AlgOptions& options) : GreedyAlgorithm(options) {
indep = new IndepZhang(options); indep = new IndepZhang(options);
if(indepName == "clb2c") if(indepName == "clb2c")
indep = new IndepCLB2C(options); indep = new IndepCLB2C(options);
if(indepName == "minmin")
indep = new IndepMinMin(options);
#ifdef WITH_CPLEX #ifdef WITH_CPLEX
if(indepName == "round") if(indepName == "round")
indep = new AreaRound(options); indep = new AreaRound(options);
......
// Created by eyraud on 25/03/19
#include "IndepMinMin.h"
#include <iostream>
#include <set>
#include "util.h"
using namespace std;
IndepMinMin::IndepMinMin(const AlgOptions& options) : IndepAllocator(options) {
needsPreciseLoads = true;
}
int IndepMinMin::getEarliestWorker(vector<double> &loads, int type) {
int best = workerIndices[type];
int to = workerIndices[type+1];
for(int i = workerIndices[type]; i < to; ++i){
if(loads[i] < loads[best])
best = i;
}
return best;
}
double IndepMinMin::endTime(vector<double> &loads, int workerType, int task) {
return loads[bestWorkers[workerType]] + ins->execType(workerType, task);
}
IndepResult IndepMinMin::compute(Instance & ins, vector<int> &taskSet, vector<double> &loads) {
this->ins = & ins;
workerIndices.resize(ins.nbWorkerTypes + 1);
bestWorkers.resize(ins.nbWorkerTypes);
workerIndices[0] = 0;
for(int i = 0; i < ins.nbWorkerTypes; ++i) {
workerIndices[i+1] = workerIndices[i] + ins.nbWorkers[i];
bestWorkers[i] = getEarliestWorker(loads, i);
}
IndepResult result(ins.nbWorkerTypes);
set<int> tasks(taskSet.begin(), taskSet.end());
int nbTasks = taskSet.size();
while(nbTasks > 0) {
int bestWorkerType = -1;
int bestTask = -1;
for(int t: tasks) {
int bestWorkerTypeForThisTask = 0;
for(int j = 1; j < ins.nbWorkerTypes; ++j) {
if(endTime(loads, j, t) < endTime(loads, bestWorkerTypeForThisTask, t))
bestWorkerTypeForThisTask = j;
}
if(bestTask < 0 ||
endTime(loads, bestWorkerTypeForThisTask, t) < endTime(loads, bestWorkerType, bestTask)) {
bestTask = t;
bestWorkerType = bestWorkerTypeForThisTask;
}
}
result[bestWorkerType].push_back(bestTask);
loads[bestWorkers[bestWorkerType]] += ins.execType(bestWorkerType, bestTask);
bestWorkers[bestWorkerType] = getEarliestWorker(loads, bestWorkerType);
nbTasks -= 1;
tasks.erase(bestTask);
}
return(result);
}
// Possibilities
// As an IndepAllocator, close to CLB2C
//
// O(n^2m') m' = # worker types
// Until done: O(n)
// find best worker for each type of worker O(m)
// Find smallest ready task for each type of worker O(nm') =>O(m'(1+update))
// Assign.
// Keep ordered sets of tasks, one for each worker type ? Updates seem costly, but worst case is still better
// Keep best worker for each type ? Avoids recomputation.
// What about MaxMin ?
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