improved planner

This commit is contained in:
ALEXks
2025-03-03 13:36:20 +03:00
parent e98127880b
commit 9b02a5c9ea
2 changed files with 10 additions and 3 deletions

View File

@@ -114,6 +114,7 @@ public:
changeState();
}
vector<T*> taskList;
map<int, queue<T*>, std::greater<int>> sortedByKernelNeeds;
size_t activeTasks = 0;
size_t totalProcessTasks = 0;
@@ -126,6 +127,7 @@ public:
sortedByKernelNeeds[task->getKernels()].push(task);
if (maxNeededKernels < task->getKernels())
maxNeededKernels = task->getKernels();
taskList.push_back(task);
}
}
@@ -155,7 +157,7 @@ public:
vector<T*> toDel;
size_t done = 0;
size_t step = ceil(totalProcessTasks * 0.01); // step == 1%
size_t step = ceil(totalProcessTasks * 0.02); // step == 2%
const double total = totalProcessTasks;
auto timer_start = Utils::getAbsoluteTime();
@@ -206,7 +208,8 @@ public:
printf(" done task with %d kernels and id %ld\n", task->getKernels(), task->getId());
#endif
buf += to_string(task->getId()) + " " + string(task->printState().getCharArray()) + " " + to_string(task->getTotalTime()) + "\n";
task->copyResults(pathRes);
//copy after end of while
//task->copyResults(pathRes);
}
}
@@ -235,6 +238,9 @@ public:
}
}
for (auto& task : taskList)
task->copyResults(pathRes);
changeState();
String outFile(pathRes + "/" + getStatePrefix() + "Info.txt");
@@ -250,6 +256,7 @@ public:
FILE *f = fopen("progress", "w");
if (f) {
fprintf(f, "%lld", persentDone);
fflush(f);
fclose(f);
}
}

View File

@@ -1 +1 @@
10
11