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

Bugfix

parent 55cc212b
......@@ -33,6 +33,10 @@ dataAvailTimes(ins->itemSizes.size()), sourceLocation(ins->itemSizes.size(), -1)
double ItemManager::sendItemTo(int item, int dstMemNode, double currentTime) {
if(dataAvailTimes[item][dstMemNode] < 0) {
int src = sourceLocation[item]; // Ideally, I could choose the source location that minimizes commEndTime ?
if (src < 0 || src >= ins->nbMemoryNodes) {
cerr << "sendItemTo for item " << ins->itemNames[item] << " to " << dstMemNode << " at " << currentTime << ": sourceLocation is invalid " << src << endl;
throw(1);
}
double commEndTime = comms.newTransfer(dataAvailTimes[item][src], src, dstMemNode, ins->itemSizes[item], currentTime);
dataAvailTimes[item][dstMemNode] = commEndTime;
return commEndTime;
......
#include "GreedyAlgorithm.h"
#include "CommSequence.h"
#include "util.h"
#include <set>
#include <iostream>
......@@ -77,13 +76,15 @@ double GreedyAlgorithm::compute(Instance& ins, SchedAction* action) {
throw(1);
}
if(verbosity >= 6)
cout << "Greedy: " << currentTime << " chosen task is #" << chosenTask << ", " << ins.taskIDs[chosenTask] << endl;
double startTime = currentTime;
if(doComms) {
// Compute a finish time which takes communication into account.
for(int &item: ins.itemsRequired[chosenTask]) {
int dst = ins.memoryNodes[t][index];
startTime = max(startTime, itemManager->sendItemTo(t, dst, currentTime));
startTime = max(startTime, itemManager->sendItemTo(item, dst, currentTime));
}
}
......
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