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

Method run

src/function/gds/gds_task.cpp:41–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void FrontierTask::run() {
42 FrontierMorsel morsel;
43 auto numActiveNodes = 0u;
44 auto graph = info.graph;
45 auto scanState = graph->prepareRelScan(*info.relGroupEntry, info.getRelTableID(),
46 info.getNbrTableID(), info.propertiesToScan);
47 auto ec = info.edgeCompute.copy();
48 auto boundTableID = info.getBoundTableID();
49 switch (info.direction) {
50 case ExtendDirection::FWD: {
51 while (sharedState->morselDispatcher.getNextRangeMorsel(morsel)) {
52 for (auto offset = morsel.getBeginOffset(); offset < morsel.getEndOffset(); ++offset) {
53 if (!sharedState->frontierPair.isActiveOnCurrentFrontier(offset)) {
54 continue;
55 }
56 nodeID_t nodeID = {offset, boundTableID};
57 for (auto chunk : graph->scanFwd(nodeID, *scanState)) {
58 auto activeNodes = ec->edgeCompute(nodeID, chunk, true);
59 sharedState->frontierPair.addNodesToNextFrontier(activeNodes);
60 numActiveNodes += activeNodes.size();
61 }
62 }
63 }
64 } break;
65 case ExtendDirection::BWD: {
66 while (sharedState->morselDispatcher.getNextRangeMorsel(morsel)) {
67 for (auto offset = morsel.getBeginOffset(); offset < morsel.getEndOffset(); ++offset) {
68 if (!sharedState->frontierPair.isActiveOnCurrentFrontier(offset)) {
69 continue;
70 }
71 nodeID_t nodeID = {offset, boundTableID};
72 for (auto chunk : graph->scanBwd(nodeID, *scanState)) {
73 auto activeNodes = ec->edgeCompute(nodeID, chunk, false);
74 sharedState->frontierPair.addNodesToNextFrontier(activeNodes);
75 numActiveNodes += activeNodes.size();
76 }
77 }
78 }
79 } break;
80 default:
81 UNREACHABLE_CODE;
82 }
83 if (numActiveNodes) {
84 sharedState->frontierPair.setActiveNodesForNextIter();
85 }
86}
87
88void FrontierTask::runSparse() {
89 auto numActiveNodes = 0u;

Callers 2

runWorkerThreadMethod · 0.45
runTaskMethod · 0.45

Calls 15

prepareRelScanMethod · 0.80
getRelTableIDMethod · 0.80
getBoundTableIDMethod · 0.80
getNextRangeMorselMethod · 0.80
getBeginOffsetMethod · 0.80
getEndOffsetMethod · 0.80
scanFwdMethod · 0.80
scanBwdMethod · 0.80
hasPropertiesToScanMethod · 0.80
prepareVertexScanMethod · 0.80

Tested by

no test coverage detected