MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / init

Method init

src/function/gds/frontier_morsel.cpp:13–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13void FrontierMorselDispatcher::init(offset_t _maxOffset) {
14 maxOffset = _maxOffset;
15 nextOffset.store(0u);
16 // Frontier size calculation: The ideal scenario is to have k^2 many morsels where k
17 // the number of maximum threads that could be working on this frontier. However, if
18 // that is too small then we default to MIN_FRONTIER_MORSEL_SIZE.
19 auto idealMorselSize =
20 maxOffset / std::max(MIN_NUMBER_OF_FRONTIER_MORSELS, maxThreads * maxThreads);
21 morselSize = std::max(MIN_FRONTIER_MORSEL_SIZE, idealMorselSize);
22}
23
24bool FrontierMorselDispatcher::getNextRangeMorsel(FrontierMorsel& frontierMorsel) {
25 auto beginOffset = nextOffset.fetch_add(morselSize, std::memory_order_acq_rel);

Callers 1

getNextRangeMorselMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected