alsk/plot/executor/firstlevelgreedy.cpp

20 lines
442 B
C++
Raw Permalink Normal View History

2021-05-10 16:14:13 +00:00
#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;
}