Commit 122248b2 authored by Unai Perez's avatar Unai Perez
Browse files

Merge branch 'ppc/demo-scwc' of gitlab-internal.bsc.es:ppc/software/compss into ppc/demo-scwc

parents e9aa63a8 e1ee6db8
......@@ -179,6 +179,18 @@ public class LNSNL {
lines = br.readLine();
st = lines.trim().split("\\s+");
float overhead = Float.parseFloat(st[2].substring(0,st[2].indexOf(";")));
ArrayList<String> workersOrder = new ArrayList<>(m);
lines = br.readLine();
st = lines.trim().split("\\s+");
for (int j = 2; j < st.length - 1; j++) {
if (j == 2) {
int pos = st[j].indexOf('[');
workersOrder.add(st[j].substring(pos + 1));
} else {
workersOrder.add(st[j]);
}
}
Resources resources = new Resources(ibw, mfs, h, overhead, m);
resources.setResourceNames(workers);
......@@ -189,7 +201,7 @@ public class LNSNL {
for (int i = 0; i < n; ++i) {
times[i] = C[i][j];
}
mapC.put(workers.get(j), times);
mapC.put(workersOrder.get(j), times);
}
DAG dag = new DAG(mapC, z, succ, n);
this.dag = dag;
......
......@@ -285,19 +285,43 @@ public class PrometheusScheduler extends TaskScheduler {
client.updateWorkerList(this.workingWorkerList); //all workers added
}
private void relaunchWorker(Worker<? extends WorkerResourceDescription> w) {
MethodWorker methodWorker = (MethodWorker) w;
COMPSsWorker worker = (COMPSsWorker) methodWorker.getNode();
String name = worker.getName();
MethodResourceDescription description = methodWorker.getDescription();
Map<String, String> sharedDisks = methodWorker.getSharedDisks();
int limitOfTasks = description.getTotalCPUComputingUnits();
int limitGPUTasks = description.getTotalGPUComputingUnits();
int limitFPGATasks = description.getTotalFPGAComputingUnits();
int limitOTHERTasks = description.getTotalOTHERComputingUnits();
DynamicMethodWorker dnm = new DynamicMethodWorker(name, description, worker, limitOfTasks, limitGPUTasks,
limitFPGATasks, limitOTHERTasks, sharedDisks);
ResourceManager.addDynamicWorker(dnm, description);
}
private void applyChanges(List<String> removedWorkers, List<String> resumedWorkers, float safetyMargin) {
boolean reschedule = false;
for (String worker : removedWorkers) {
//if (!this.removedWorkers.containsKey(worker)) {
if (this.workingWorkerList.contains(worker)) {
lnsnl.removeResource(worker);
//System.out.println("Worker " + worker + " removed");
//Worker<?> workerToRemove = ResourceManager.getWorker(worker);
//ResourceManager.removeWorker(workerToRemove);
//this.removedWorkers.put(worker, workerToRemove);
this.workingWorkerList.remove(worker);
reschedule = true;
}
}
for (String worker : resumedWorkers) {
//if (this.removedWorkers.containsKey(worker)) {
if (!this.workingWorkerList.contains(worker)) {
lnsnl.addResource(worker);
//Worker<?> workerToResume = this.removedWorkers.get(worker);
//this.removedWorkers.remove(worker);
//relaunchWorker(workerToResume);
this.workingWorkerList.add(worker);
reschedule = true;
}
......
Supports Markdown
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