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

Method runSparse

src/function/gds/gds_task.cpp:88–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void FrontierTask::runSparse() {
89 auto numActiveNodes = 0u;
90 auto graph = info.graph;
91 auto scanState = graph->prepareRelScan(*info.relGroupEntry, info.getRelTableID(),
92 info.getNbrTableID(), info.propertiesToScan);
93 auto ec = info.edgeCompute.copy();
94 auto boundTableID = info.getBoundTableID();
95 switch (info.direction) {
96 case ExtendDirection::FWD: {
97 for (const auto offset : sharedState->frontierPair.getActiveNodesOnCurrentFrontier()) {
98 auto nodeID = nodeID_t{offset, boundTableID};
99 for (auto chunk : graph->scanFwd(nodeID, *scanState)) {
100 auto activeNodes = ec->edgeCompute(nodeID, chunk, true);
101 sharedState->frontierPair.addNodesToNextFrontier(activeNodes);
102 numActiveNodes += activeNodes.size();
103 }
104 }
105 } break;
106 case ExtendDirection::BWD: {
107 for (auto& offset : sharedState->frontierPair.getActiveNodesOnCurrentFrontier()) {
108 auto nodeID = nodeID_t{offset, boundTableID};
109 for (auto chunk : graph->scanBwd(nodeID, *scanState)) {
110 auto activeNodes = ec->edgeCompute(nodeID, chunk, false);
111 sharedState->frontierPair.addNodesToNextFrontier(activeNodes);
112 numActiveNodes += activeNodes.size();
113 }
114 }
115 } break;
116 default:
117 UNREACHABLE_CODE;
118 }
119 if (numActiveNodes) {
120 sharedState->frontierPair.setActiveNodesForNextIter();
121 }
122}
123
124void VertexComputeTask::run() {
125 FrontierMorsel morsel;

Callers 2

scheduleFrontierTaskFunction · 0.80
runVertexComputeInternalFunction · 0.80

Calls 13

prepareRelScanMethod · 0.80
getRelTableIDMethod · 0.80
getBoundTableIDMethod · 0.80
scanFwdMethod · 0.80
scanBwdMethod · 0.80
hasPropertiesToScanMethod · 0.80
getNbrTableIDMethod · 0.45
copyMethod · 0.45
edgeComputeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected