alsk/plot/executor/firstlevelgreedy.cpp
2021-05-10 18:14:13 +02:00

20 lines
442 B
C++

#include "firstlevelgreedy.h"
Split firstLevelGreedy(std::size_t n, CoresList const& coresList) {
Split split;
auto firstLevelPar = n;
split.insert(0);
for(auto const& k: coresList) {
std::size_t start{};
std::size_t const step = (firstLevelPar + k-1)/k;
std::size_t const rk = (firstLevelPar + step-1)/step;
for(unsigned int i = 0; i < rk; ++i, start += step)
split.insert(start * (n/firstLevelPar));
}
return split;
}