| 86 | } |
| 87 | |
| 88 | void 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 | |
| 124 | void VertexComputeTask::run() { |
| 125 | FrontierMorsel morsel; |
no test coverage detected