From a68f7b86802315ae151f95682d599162bd65b6c4 Mon Sep 17 00:00:00 2001 From: divija95 Date: Sat, 20 Apr 2024 02:52:13 +0000 Subject: [PATCH] fixing pre-commit --- .../galois/graphs/DistributedLocalGraph.h | 5 +-- .../galois/runtime/GraphUpdateManager.h | 32 +++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/libcusp/include/galois/graphs/DistributedLocalGraph.h b/libcusp/include/galois/graphs/DistributedLocalGraph.h index 67cb84b88..bed956848 100644 --- a/libcusp/include/galois/graphs/DistributedLocalGraph.h +++ b/libcusp/include/galois/graphs/DistributedLocalGraph.h @@ -994,7 +994,8 @@ class DistLocalGraph { mirrorNodes[getHostID(token)].push_back(token); } i++; - if (isOwned(token) && (edge_begin(getLID(token)) == edge_end(getLID(token)))) { + if (isOwned(token) && + (edge_begin(getLID(token)) == edge_end(getLID(token)))) { numNodesWithEdges++; } } @@ -1010,7 +1011,7 @@ class DistLocalGraph { template void addVertex(T data) { - uint64_t token = data.id; + uint64_t token = data.id; std::vector dataVec; dataVec.push_back(data); updateVariables(true, token); diff --git a/libgalois/include/galois/runtime/GraphUpdateManager.h b/libgalois/include/galois/runtime/GraphUpdateManager.h index 3cbb98555..0c3b73b72 100644 --- a/libgalois/include/galois/runtime/GraphUpdateManager.h +++ b/libgalois/include/galois/runtime/GraphUpdateManager.h @@ -51,7 +51,7 @@ class graphUpdateManager { template void processEdges(std::vector& edges) { - for(auto& edge : edges) { + for (auto& edge : edges) { std::vector dsts; dsts.push_back(edge.dst); std::vector dstData = fileParser->GetDstData(edges); @@ -80,17 +80,18 @@ class graphUpdateManager { } template - void processUpdates(std::vector>& updateVector) { + void processUpdates( + std::vector>& updateVector) { std::vector> updateEdges; std::vector> updateNodes; auto& net = galois::runtime::getSystemNetworkInterface(); updateNodes.resize(net.Num); updateEdges.resize(net.Num); - for(auto& update : updateVector) { - if(update.isNode) { + for (auto& update : updateVector) { + if (update.isNode) { updateNodes[graph->getHostID(update.node.id)].push_back(update.node); } else { - for(auto& edge : update.edges) { + for (auto& edge : update.edges) { updateEdges[graph->getHostID(edge.src)].push_back(edge); } } @@ -104,24 +105,23 @@ class graphUpdateManager { galois::runtime::SendBuffer b; galois::runtime::gSerialize(b, updateNodes[i]); net.sendTagged(i, galois::runtime::evilPhase, std::move(b)); - } - //Receive vertex updates from other hosts - for(uint32_t i=0; i recvNodes; galois::runtime::gDeserialize(p->second, recvNodes); - processNodes(recvNodes); + processNodes(recvNodes); } galois::runtime::evilPhase++; // Send Edge updates to the other hosts - for(uint32_t i = 0; i < net.Num; i++) { - if(i == net.ID) { + for (uint32_t i = 0; i < net.Num; i++) { + if (i == net.ID) { continue; } galois::runtime::SendBuffer b; @@ -130,18 +130,18 @@ class graphUpdateManager { } // Receive edge updates from other hosts - for(uint32_t i=0; i recvEdges; galois::runtime::gDeserialize(p->second, recvEdges); - processEdges(recvEdges); + processEdges(recvEdges); } galois::runtime::evilPhase++; - //Process own updates + // Process own updates processNodes(updateNodes[net.ID]); processEdges(updateEdges[net.ID]); } @@ -160,7 +160,8 @@ class graphUpdateManager { std::string line; std::vector> parsedData; while ((std::getline(inputFile, line))) { - parsedData.push_back(fileParser->ParseLine(const_cast(line.c_str()), line.size())); + parsedData.push_back(fileParser->ParseLine( + const_cast(line.c_str()), line.size())); } processUpdates(parsedData); inputFile.close(); @@ -168,5 +169,4 @@ class graphUpdateManager { auto& net = galois::runtime::getSystemNetworkInterface(); net.flush(); } - };