30 #ifndef _GALOIS_DIST_MINING_H
31 #define _GALOIS_DIST_MINING_H
45 template <
typename NodeTy,
typename EdgeTy,
typename Partitioner>
48 constexpr
static unsigned edgePartitionSendBufSize = 8388608;
49 constexpr
static const char*
const GRNAME =
"dGraph_Mining";
50 Partitioner* graphPartitioner;
52 uint32_t G2LEdgeCut(uint64_t gid, uint32_t globalOffset)
const {
56 return gid - globalOffset;
65 void freeVector(V& vectorToKill) {
67 vectorToKill.swap(dummyVector);
70 uint32_t nodesToReceive;
74 uint64_t globalKeptEdges;
75 uint64_t totalEdgeProxies;
77 std::vector<std::vector<size_t>> mirrorEdges;
78 std::unordered_map<uint64_t, uint64_t> localEdgeGIDToLID;
80 std::vector<uint64_t> getNodeDegrees(
const std::string filename,
82 std::vector<uint64_t> nodeDegrees;
83 nodeDegrees.resize(numNodes);
86 std::ifstream graphFile(filename.c_str());
87 graphFile.seekg(
sizeof(uint64_t) * 4);
89 uint64_t* outIndexBuffer = (uint64_t*)malloc(
sizeof(uint64_t) *
numNodes);
90 if (outIndexBuffer ==
nullptr) {
93 uint64_t numBytesToLoad = numNodes *
sizeof(uint64_t);
94 uint64_t bytesRead = 0;
96 while (numBytesToLoad > 0) {
97 graphFile.read(((
char*)outIndexBuffer) + bytesRead, numBytesToLoad);
98 size_t numRead = graphFile.gcount();
99 numBytesToLoad -= numRead;
100 bytesRead += numRead;
102 assert(numBytesToLoad == 0);
108 nodeDegrees[n] = outIndexBuffer[n] - outIndexBuffer[n - 1];
110 nodeDegrees[n] = outIndexBuffer[0];
115 free(outIndexBuffer);
125 [&](
unsigned n) { edgeCount += nodeDegrees[n]; },
158 if (gid >= start && gid < end) {
167 return graphPartitioner->retrieveMaster(gid);
185 const std::string& filename,
unsigned host,
unsigned _numHosts,
186 bool setupGluon =
true,
bool doSort =
false,
188 uint32_t nodeWeight = 0, uint32_t edgeWeight = 0)
192 "GraphPartitioningTime", GRNAME);
193 Tgraph_construct.
start();
200 std::vector<unsigned> dummy;
205 std::vector<uint64_t> ndegrees;
207 if (Partitioner::needNodeDegrees()) {
235 graphReadTimer.
start();
239 graphReadTimer.
stop();
245 inspectionTimer.
start();
255 edgeInspectionRound1(bufGraph, prefixSumOfEdges);
258 for (uint64_t i = nodeBegin; i < nodeEnd; i++) {
259 presentProxies.
set(i);
263 std::vector<galois::DynamicBitSet> proxiesOnOtherHosts;
264 proxiesOnOtherHosts.resize(_numHosts);
267 communicateProxyInfo(presentProxies, proxiesOnOtherHosts);
271 std::vector<std::vector<uint64_t>> numOutgoingEdges;
275 edgeInspectionRound2(bufGraph, numOutgoingEdges, proxiesOnOtherHosts);
278 finalizePrefixSum(numOutgoingEdges, prefixSumOfEdges);
281 freeVector(numOutgoingEdges);
282 inspectionTimer.
stop();
287 allocationTimer.
start();
300 [&](uint64_t n) { base_graph.fixEndEdge(n, prefixSumOfEdges[n]); },
306 prefixSumOfEdges.clear();
307 freeVector(prefixSumOfEdges);
309 allocationTimer.
stop();
317 TfillMirrors.
start();
326 proxiesOnOtherHosts.clear();
336 "FillMirrorsEdges", GRNAME);
337 TfillMirrorsEdges.
start();
341 "] Filling mirrors and creating "
343 fillMirrorsEdgesAndCreateMirrorMap();
344 TfillMirrorsEdges.
stop();
354 Tthread_ranges.
start();
359 Tthread_ranges.
stop();
361 Tgraph_construct.
stop();
367 totalEdgeProxies = accumer.
reduce();
369 uint64_t totalNodeProxies;
372 totalNodeProxies = accumer.
reduce();
377 GRNAME, std::string(
"TotalNodeProxies"), totalNodeProxies);
379 GRNAME, std::string(
"TotalEdgeProxies"), totalEdgeProxies);
381 std::string(
"OriginalNumberEdges"),
387 GRNAME, std::string(
"ReplicationFactorNodes"),
390 GRNAME, std::string(
"ReplicatonFactorEdges"),
391 (totalEdgeProxies) / (
double)globalKeptEdges);
406 incomingMirrors.
reset();
425 uint64_t edgeCount = 0;
428 allEdges += std::distance(ii, ee);
429 for (; ii < ee; ++ii) {
432 if (graphPartitioner->keepEdge(n, dst)) {
436 if (graphPartitioner->retrieveMaster(dst) != myID) {
437 incomingMirrors.
set(dst);
441 prefixSumOfEdges[n - globalOffset] = edgeCount;
442 ltgv[n - globalOffset] = n;
450 myReadEdges = allEdges.
reduce();
451 globalKeptEdges = keptEdges.
reduce();
454 uint32_t additionalMirrorCount = incomingMirrors.
count();
460 prefixSumOfEdges.resize(prefixSumOfEdges.size() + additionalMirrorCount,
463 prefixSumOfEdges.resize(additionalMirrorCount, 0);
467 if (additionalMirrorCount > 0) {
470 std::vector<uint64_t> threadPrefixSums(activeThreads);
474 std::tie(beginNode, endNode) =
477 for (
size_t i = beginNode; i < endNode; i++) {
478 if (incomingMirrors.
test(i))
481 threadPrefixSums[tid] = count;
484 for (
unsigned int i = 1; i < threadPrefixSums.size(); i++) {
485 threadPrefixSums[i] += threadPrefixSums[i - 1];
488 assert(threadPrefixSums.back() == additionalMirrorCount);
495 std::tie(beginNode, endNode) =
498 uint32_t threadStartLocation = 0;
500 threadStartLocation = threadPrefixSums[tid - 1];
502 uint32_t handledNodes = 0;
503 for (
size_t i = beginNode; i < endNode; i++) {
504 if (incomingMirrors.
test(i)) {
506 threadStartLocation +
528 return incomingMirrors;
537 void communicateProxyInfo(
539 std::vector<galois::DynamicBitSet>& proxiesOnOtherHosts) {
545 galois::runtime::gSerialize(bitsetBuffer, presentProxies);
551 for (
unsigned h = 0; h < net.Num - 1; h++) {
556 uint32_t sendingHost = p->first;
559 proxiesOnOtherHosts[sendingHost]);
565 void edgeInspectionRound2(
567 std::vector<std::vector<uint64_t>>& numOutgoingEdges,
568 std::vector<galois::DynamicBitSet>& proxiesOnOtherHosts) {
576 numOutgoingEdges[i].assign(numRead, 0);
581 hostHasOutgoing.
resize(base_DistGraph::numHosts);
582 hostHasOutgoing.
reset();
593 for (; ii < ee; ++ii) {
596 if (graphPartitioner->keepEdge(n, dst)) {
597 for (
unsigned h = 0; h < net.Num; h++) {
599 if (proxiesOnOtherHosts[h].test(n)) {
601 if (proxiesOnOtherHosts[h].test(dst)) {
604 numOutgoingEdges[h][n - globalOffset] += 1;
605 hostHasOutgoing.
set(h);
619 sendInspectionData(numOutgoingEdges, hostHasOutgoing);
620 recvInspectionData(numOutgoingEdges);
632 void sendInspectionData(std::vector<std::vector<uint64_t>>& numOutgoingEdges,
639 for (
unsigned h = 0; h < net.Num; h++) {
648 if (hostHasOutgoing.
test(h)) {
649 galois::runtime::gSerialize(b, 1);
650 galois::runtime::gSerialize(b, numOutgoingEdges[h]);
652 galois::runtime::gSerialize(b, 0);
654 numOutgoingEdges[h].clear();
663 GRNAME, std::string(
"EdgeInspectionBytesSent"), bytesSent.
reduce());
676 recvInspectionData(std::vector<std::vector<uint64_t>>& numOutgoingEdges) {
679 for (
unsigned h = 0; h < net.Num - 1; h++) {
686 uint32_t sendingHost = p->first;
689 uint32_t outgoingExists = 2;
692 if (outgoingExists == 1) {
695 }
else if (outgoingExists == 0) {
697 numOutgoingEdges[sendingHost].clear();
704 "] Inspection receives complete.\n");
712 finalizePrefixSum(std::vector<std::vector<uint64_t>>& numOutgoingEdges,
716 inspectOutgoingNodes(numOutgoingEdges, prefixSumOfEdges);
717 finalizeInspection(prefixSumOfEdges);
719 "] To receive this many nodes: ", nodesToReceive);
721 "] Inspection allocation complete.\n");
722 return prefixSumOfEdges;
730 inspectOutgoingNodes(std::vector<std::vector<uint64_t>>& numOutgoingEdges,
737 assert(proxyEnd == prefixSumOfEdges.size());
740 edgesToReceive.
reset();
750 assert(hostReader < base_DistGraph::numHosts);
754 if (numOutgoingEdges[hostReader].
size()) {
755 if (numOutgoingEdges[hostReader][gid - nodeOffset]) {
757 prefixSumOfEdges[lid] =
758 numOutgoingEdges[hostReader][gid - nodeOffset];
759 edgesToReceive += numOutgoingEdges[hostReader][gid - nodeOffset];
768 edgesToReceive.reduce(),
" edges; self is ", myKeptEdges,
771 numOutgoingEdges.clear();
772 nodesToReceive = toReceive.
reduce();
781 prefixSumOfEdges[i] += prefixSumOfEdges[i - 1];
783 if (prefixSumOfEdges.size() != 0) {
799 mapConstructTimer.
start();
807 assert((*edge) == count);
809 uint64_t localGID = getEdgeGIDFromSD(src, dst);
811 localEdgeGIDToLID.insert(std::make_pair(localGID, count));
819 mapConstructTimer.
stop();
841 uint64_t localGID = getEdgeGIDFromSD(src, dst);
842 auto findResult = localEdgeGIDToLID.find(localGID);
845 if (findResult != localEdgeGIDToLID.end()) {
846 return std::make_pair(findResult->second,
true);
849 return std::make_pair((uint64_t)-1,
false);
854 uint64_t sourceNodeGID = edgeGIDToSource(gid);
860 if (edgeDst == destNodeLID) {
878 if (edge_left <= lid && lid < edge_right) {
890 return getEdgeGIDFromSD(src, dst);
898 uint64_t getEdgeGIDFromSD(uint32_t source, uint32_t dest) {
903 uint64_t edgeGIDToSource(uint64_t gid) {
907 uint64_t edgeGIDToDest(uint64_t gid) {
923 .push_back(globalID);
927 void fillMirrorsEdgesAndCreateMirrorMap() {
933 unsigned sourceOwner = graphPartitioner->retrieveMaster(globalSource);
935 for (; ee != ee_end; ++ee) {
937 uint64_t edgeGID = getEdgeGIDFromSD(
940 mirrorEdges[sourceOwner].push_back(edgeGID);
947 template <
typename GraphTy>
949 std::vector<galois::DynamicBitSet>& proxiesOnOtherHosts) {
951 loadEdgeTimer.start();
954 std::atomic<uint32_t> receivedNodes;
955 receivedNodes.store(0);
958 sendEdges(graph, bufGraph, receivedNodes, proxiesOnOtherHosts);
965 [&](
unsigned GALOIS_UNUSED(tid),
unsigned GALOIS_UNUSED(nthreads)) {
966 receiveEdges(graph, receivedNodes);
969 loadEdgeTimer.stop();
972 loadEdgeTimer.get_usec() / 1000000.0f,
" seconds\n");
976 template <
typename GraphTy>
978 std::atomic<uint32_t>& receivedNodes,
979 std::vector<galois::DynamicBitSet>& proxiesOnOtherHosts) {
980 using DstVecType = std::vector<std::vector<uint64_t>>;
981 using SendBufferVecTy = std::vector<galois::runtime::SendBuffer>;
984 base_DistGraph::numHosts);
986 base_DistGraph::numHosts);
995 messagesSent.
reset();
997 maxBytesSent.
reset();
1005 uint64_t curEdge = 0;
1007 lsrc = this->
G2L(src);
1012 auto ee_end = bufGraph.
edgeEnd(src);
1013 auto& gdst_vec = *gdst_vecs.getLocal();
1015 for (
unsigned i = 0; i <
numHosts; ++i) {
1016 gdst_vec[i].clear();
1019 for (; ee != ee_end; ++ee) {
1022 if (graphPartitioner->keepEdge(src, gdst)) {
1024 uint32_t ldst = this->
G2L(gdst);
1025 graph.constructEdge(curEdge++, ldst);
1027 for (
unsigned h = 0; h < net.Num; h++) {
1029 if (proxiesOnOtherHosts[h].test(src)) {
1031 if (proxiesOnOtherHosts[h].test(gdst)) {
1034 gdst_vec[h].push_back(gdst);
1044 assert(curEdge == (*graph.edge_end(lsrc)));
1048 for (uint32_t h = 0; h <
numHosts; ++h) {
1052 if (gdst_vec[h].
size() > 0) {
1053 auto& b = (*sendBuffers.getLocal())[h];
1054 galois::runtime::gSerialize(b, src);
1055 galois::runtime::gSerialize(b, gdst_vec[h]);
1058 if (b.
size() > edgePartitionSendBufSize) {
1072 this->processReceivedEdgeBuffer(buffer, graph, receivedNodes);
1080 for (
unsigned threadNum = 0; threadNum < sendBuffers.size(); ++threadNum) {
1081 auto& sbr = *sendBuffers.getRemote(threadNum);
1085 auto& sendBuffer = sbr[h];
1086 if (sendBuffer.size() > 0) {
1088 bytesSent.
update(sendBuffer.size());
1089 maxBytesSent.
update(sendBuffer.size());
1092 sendBuffer.getVec().clear();
1100 GRNAME, std::string(
"EdgeLoadingMessagesSent"), messagesSent.
reduce());
1102 GRNAME, std::string(
"EdgeLoadingBytesSent"), bytesSent.
reduce());
1104 GRNAME, std::string(
"EdgeLoadingMaxBytesSent"), maxBytesSent.
reduce());
1108 template <
typename GraphTy>
1109 void processReceivedEdgeBuffer(
1110 std::optional<std::pair<uint32_t, galois::runtime::RecvBuffer>>& buffer,
1111 GraphTy& graph, std::atomic<uint32_t>& receivedNodes) {
1113 auto& rb = buffer->second;
1114 while (rb.r_size() > 0) {
1116 std::vector<uint64_t> gdst_vec;
1120 uint32_t lsrc = this->
G2L(n);
1122 uint64_t cur_end = *graph.edge_end(lsrc);
1123 assert((cur_end - cur) == gdst_vec.size());
1124 deserializeEdges(graph, gdst_vec, cur, cur_end);
1134 template <
typename GraphTy>
1135 void receiveEdges(GraphTy& graph, std::atomic<uint32_t>& receivedNodes) {
1139 while (receivedNodes < nodesToReceive) {
1142 processReceivedEdgeBuffer(p, graph, receivedNodes);
1146 template <
typename GraphTy>
1147 void deserializeEdges(GraphTy& graph, std::vector<uint64_t>& gdst_vec,
1148 uint64_t& cur, uint64_t& cur_end) {
1150 while (cur < cur_end) {
1151 uint64_t gdst = gdst_vec[i++];
1152 uint32_t ldst = this->
G2L(gdst);
1153 graph.constructEdge(cur++, ldst);
1157 virtual bool is_vertex_cut()
const {
return false; }
1161 template <
typename NodeTy,
typename EdgeTy,
typename Partitioner>
1162 constexpr
const char*
const
size_t sizeEdges() const
Gets number of edges on this (local) graph.
Definition: DistributedGraph.h:653
std::vector< std::vector< size_t > > & getMirrorEdges()
Definition: MiningPartitioner.h:147
EdgeIterator edgeEnd(uint64_t globalNodeID)
Get the index to the first edge of the node after the provided node.
Definition: BufferedGraph.h:414
Distributed sum-reducer for getting the sum of some value across multiple hosts.
Definition: DReducible.h:45
galois::GAccumulator< uint64_t > lgMapAccesses
Definition: MiningPartitioner.h:792
uint64_t numGlobalEdges
Total edges in the global unpartitioned graph.
Definition: DistributedGraph.h:80
void gInfo(Args &&...args)
Prints an info string from a sequence of things.
Definition: gIO.h:55
uint64_t getEdgeLID(uint64_t gid)
Definition: MiningPartitioner.h:853
void increment_evilPhase()
Increments evilPhase, a phase counter used by communication.
Definition: DistributedGraph.h:133
unsigned int getActiveThreads() noexcept
Returns the number of threads in use.
Definition: Threads.cpp:37
std::pair< IterTy, IterTy > block_range(IterTy b, IterTy e, unsigned id, unsigned num)
Returns a continuous block from the range based on the number of divisions and the id of the block re...
Definition: gstl.h:244
void reset()
Definition: Reduction.h:113
uint64_t getGID(const uint32_t nodeID) const
Converts a local node id into a global node id.
Definition: DistributedGraph.h:562
Class that loads a portion of a Galois graph from disk directly into memory buffers for access...
Definition: BufferedGraph.h:49
uint64_t numGlobalNodes
Total nodes in the global unpartitioned graph.
Definition: DistributedGraph.h:79
const uint32_t numHosts
Total number of machines.
Definition: DistributedGraph.h:85
uint32_t getLID(const uint64_t nodeID) const
Converts a global node id into a local node id.
Definition: DistributedGraph.h:570
EdgeIterator edgeBegin(uint64_t globalNodeID)
Get the index to the first edge of the provided node THAT THIS GRAPH HAS LOADED (not necessary the fi...
Definition: BufferedGraph.h:386
void reportStat_Tmax(const S1 ®ion, const S2 &category, const T &value)
Definition: Statistics.h:556
virtual unsigned getHostID(uint64_t gid) const
Determines which host has the master for a particular node.
Definition: MiningPartitioner.h:165
Definition: MiningPartitioner.h:46
Concurrent dynamically allocated bitset.
Definition: libgalois/include/galois/DynamicBitset.h:47
void reportParam(const S1 ®ion, const S2 &category, const V &value)
Definition: Statistics.h:616
Buffer for serialization of data.
Definition: Serialize.h:56
void constructLocalEdgeGIDMap()
Construct a map from local edge GIDs to LID.
Definition: MiningPartitioner.h:796
uint64_t globalEdges() const
Returns # edges kept in all graphs.
Definition: MiningPartitioner.h:145
GraphNode getEdgeDst(edge_iterator ni)
Gets edge destination of edge ni.
Definition: DistributedGraph.h:606
~MiningGraph()
Free the graph partitioner.
Definition: MiningPartitioner.h:398
void gDebug(Args &&...GALOIS_USED_ONLY_IN_DEBUG(args))
Prints a debug string from a sequence of things; prints nothing if NDEBUG is defined.
Definition: gIO.h:72
void reportAccessBefore()
Definition: MiningPartitioner.h:822
void sortEdgesByDestination()
Sort the underlying LC_CSR_Graph by ID (destinations) It sorts edges of the nodes by destination...
Definition: DistributedGraph.h:850
size_t size() const
Gets number of nodes on this (local) graph.
Definition: DistributedGraph.h:646
void gDeserialize(DeSerializeBuffer &buf, T1 &&t1, Args &&...args)
Deserialize data in a buffer into a series of objects.
Definition: Serialize.h:1032
Ty reset()
Reset the entire accumulator.
Definition: DReducible.h:153
const char * loopname
Definition: Executor_ParaMeter.h:145
#define GALOIS_DIE(...)
Definition: gIO.h:96
uint64_t numEdges
Num edges in this graph in total.
Definition: DistributedGraph.h:82
void resetReadCounters()
Reset reading counters.
Definition: BufferedGraph.h:496
void reportStat_Tsum(const S1 ®ion, const S2 &category, const T &value)
Definition: Statistics.h:562
vTy & getVec()
Returns vector of data stored in this serialize buffer.
Definition: Serialize.h:115
bool test(size_t index) const
Check a bit to see if it is currently set.
Definition: libgalois/include/galois/DynamicBitset.h:192
uint32_t G2L(uint64_t gid) const
Definition: DistributedGraph.h:482
size_t globalSizeEdges() const
Gets number of edges on the global unpartitioned graph.
Definition: DistributedGraph.h:683
void determineThreadRanges()
Uses a pre-computed prefix sum to determine division of nodes among threads.
Definition: DistributedGraph.h:725
void reserve(size_t n)
Definition: PODResizeableArray.h:129
edge_iterator edge_begin(GraphNode N)
Definition: OfflineGraph.h:278
edge_iterator edge_begin(GraphNode N)
Gets the first edge of some node.
Definition: DistributedGraph.h:614
Accumulator for T where accumulation is max.
Definition: Reduction.h:189
void loadPartialGraph(const std::string &filename, uint64_t nodeStart, uint64_t nodeEnd, uint64_t edgeStart, uint64_t edgeEnd, uint64_t numGlobalNodes, uint64_t numGlobalEdges)
Given a node/edge range to load, loads the specified portion of the graph into memory buffers using r...
Definition: BufferedGraph.h:348
#define GALOIS_ASSERT(cond,...)
Like assert but unconditionally executed.
Definition: gIO.h:102
uint64_t count() const
Count how many bits are set in the bitset.
Definition: libgalois/include/galois/DynamicBitset.h:320
std::vector< std::vector< size_t > > mirrorNodes
Mirror nodes from different hosts. For reduce.
Definition: DistributedGraph.h:100
void resize(uint64_t n)
Resizes the bitset.
Definition: libgalois/include/galois/DynamicBitset.h:78
std::vector< std::pair< uint64_t, uint64_t > > gid2host
Information that converts host to range of nodes that host reads.
Definition: DistributedGraph.h:98
std::vector< T, Pow2Alloc< T >> Vector
[STL vector using Pow_2_VarSizeAlloc]
Definition: gstl.h:52
unsigned getHostReader(uint64_t gid) const
Return the reader of a particular node.
Definition: MiningPartitioner.h:154
virtual bool isOwned(uint64_t gid) const
Determine if a node has a master on this host.
Definition: MiningPartitioner.h:170
void reportStat_Single(const S1 ®ion, const S2 &category, const T &value)
Definition: Statistics.h:544
Definition: PerThreadStorage.h:88
galois::runtime::iterable< galois::NoDerefIterator< edge_iterator > > edges(GraphNode N)
Returns an iterable object over the edges of a particular node in the graph.
Definition: DistributedGraph.h:636
void reset()
Gets the space taken by the bitset.
Definition: libgalois/include/galois/DynamicBitset.h:110
Definition: OfflineGraph.h:63
size_type size() const
Returns the size of the serialize buffer.
Definition: Serialize.h:125
void constructNodes()
Definition: LC_CSR_Graph.h:570
MASTERS_DISTRIBUTION
Enums specifying how masters are to be distributed among hosts.
Definition: DistributedGraph.h:48
void determineThreadRangesMaster()
Determines the thread ranges for master nodes only and saves them to the object.
Definition: DistributedGraph.h:736
void gPrint(Args &&...args)
Prints a sequence of things.
Definition: gIO.h:47
edge_iterator edge_end(GraphNode N)
Gets the end edge boundary of some node.
Definition: DistributedGraph.h:625
unsigned int activeThreads
Definition: Threads.cpp:26
boost::counting_iterator< uint64_t > edge_iterator
Definition: OfflineGraph.h:194
NetworkInterface & getSystemNetworkInterface()
Get the network interface.
Definition: Network.cpp:131
MiningGraph(const std::string &filename, unsigned host, unsigned _numHosts, bool setupGluon=true, bool doSort=false, galois::graphs::MASTERS_DISTRIBUTION md=BALANCED_EDGES_OF_MASTERS, uint32_t nodeWeight=0, uint32_t edgeWeight=0)
Constructor.
Definition: MiningPartitioner.h:184
size_t globalSize() const
Gets number of nodes on the global unpartitioned graph.
Definition: DistributedGraph.h:676
uint32_t numNodes
Num nodes in this graph in total.
Definition: DistributedGraph.h:81
void clear()
Definition: PODResizeableArray.h:147
Contains the implementation for DistGraph.
uint32_t numOwned
Number of nodes owned (masters) by this host.
Definition: DistributedGraph.h:89
void do_all(const RangeFunc &rangeMaker, FunctionTy &&fn, const Args &...args)
Standard do-all loop.
Definition: Loops.h:71
bool set(size_t index)
Set a bit in the bitset.
Definition: libgalois/include/galois/DynamicBitset.h:206
void reportAccess()
Definition: MiningPartitioner.h:827
uint32_t numNodesWithEdges
Number of nodes (masters + mirrors) that have outgoing edges.
Definition: DistributedGraph.h:94
uint64_t numOwnedEdges() const
Returns edges owned by this graph (i.e.
Definition: MiningPartitioner.h:140
void start()
Definition: Timer.cpp:82
void on_each(FunctionTy &&fn, const Args &...args)
Low-level parallel loop.
Definition: Loops.h:86
uint64_t computeMasters(MASTERS_DISTRIBUTION masters_distribution, galois::graphs::OfflineGraph &g, const std::vector< unsigned > &scalefactor, uint32_t nodeWeight=0, uint32_t edgeWeight=0, unsigned DecomposeFactor=1)
Wrapper call that will call into more specific compute masters functions that compute masters based o...
Definition: DistributedGraph.h:364
virtual bool isLocal(uint64_t gid) const
Determine if a node has a proxy on this host.
Definition: MiningPartitioner.h:175
void initializeSpecificRanges()
Initializes the 3 range objects that a user can access to iterate over the graph in different ways...
Definition: DistributedGraph.h:785
Ty read_local()
Read local accumulated value.
Definition: DReducible.h:133
T & reduce()
Returns the final reduction value.
Definition: Reduction.h:102
size_t size() const
Definition: OfflineGraph.h:271
std::unordered_map< uint64_t, uint32_t > globalToLocalMap
LID = globalToLocalMap[GID].
Definition: DistributedGraph.h:105
Ty reduce(std::string runID=std::string())
Reduce data across all hosts, saves the value, and returns the reduced value.
Definition: DReducible.h:169
std::pair< uint64_t, bool > getLIDFromMap(unsigned src, unsigned dst)
checks map constructed above to see which local id corresponds to a node/edge (if it exists) ...
Definition: MiningPartitioner.h:838
uint32_t evilPhase
Variable that keeps track of which network send/recv phase a program is currently on...
Definition: Network.cpp:36
uint64_t getEdgeGID(uint64_t lid)
Definition: MiningPartitioner.h:887
Base DistGraph class that all distributed graphs extend from.
Definition: DistributedGraph.h:64
auto iterate(C &cont)
Definition: Range.h:323
void update(T &&rhs)
Updates the thread local value by applying the reduction operator to current and newly provided value...
Definition: Reduction.h:90
void resetAndFree()
Free all of the in memory buffers in this object and reset graph status.
Definition: BufferedGraph.h:516
std::vector< uint64_t > localToGlobalVector
GID = localToGlobalVector[LID].
Definition: DistributedGraph.h:103
const unsigned id
ID of the machine.
Definition: DistributedGraph.h:84
void allocateFrom(const FileGraph &graph)
Definition: LC_CSR_Graph.h:513
size_t sizeEdges() const
Definition: OfflineGraph.h:272
uint64_t edgeDestination(uint64_t globalEdgeID)
Get the global node id of the destination of the provided edge.
Definition: BufferedGraph.h:437
void stop()
Definition: Timer.cpp:87
Implements distributed reducible objects for easy reduction of values across a distributed system...
Galois Timer that automatically reports stats upon destruction Provides statistic interface around ti...
Definition: Timer.h:63
uint32_t findSourceFromEdge(uint64_t lid)
Definition: MiningPartitioner.h:868
GraphTy graph
The internal graph used by DistGraph to represent the graph.
Definition: DistributedGraph.h:73
void determineThreadRangesWithEdges()
Determines the thread ranges for nodes with edges only and saves them to the object.
Definition: DistributedGraph.h:762
uint32_t beginMaster
Local id of the beginning of master nodes.
Definition: DistributedGraph.h:91
balance edges
Definition: DistributedGraph.h:52