This commit is contained in:
2023-12-05 13:20:43 +03:00
parent 15a179d8e9
commit 79cf5bc0da

View File

@@ -157,14 +157,12 @@ public:
for (auto& empty : emptyKeys)
sortedByKernelNeeds.erase(empty);
vector<T*> toDel;
// проверяем нет ли завершившихся задач
for (auto it = activeTaskSet.begin(); it != activeTaskSet.end(); )
for (auto& task : activeTaskSet)
{
T* task = *(it);
if (task->Check()) {
it++;
activeTaskSet.erase(task);
toDel.push_back(task);
activeTasks--;
done++;
busyKernels -= task->getKernels();
@@ -172,11 +170,12 @@ public:
buf += to_string(task->getId()) + " " + string(task->printState().getCharArray()) + " " + to_string(task->getTotalTime()) + "\n";
task->copyResults(pathRes);
continue;
}
it++;
}
for (auto& del : toDel)
activeTaskSet.erase(del);
if (oldActiveTasks != activeTasks)
printf("done %ld / %ld\n", done, this->getLength());
}