Skip to content

Commit

Permalink
Fixing gluon bugs for batched mirror exchange (#55)
Browse files Browse the repository at this point in the history
* gluon support to exchange delta mirrors between edit batches

* fixing gluon errors
  • Loading branch information
divija95 authored Apr 18, 2024
1 parent 4a0158d commit 5835f9b
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions libgluon/include/galois/graphs/GluonSubstrate.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ class GluonSubstrate : public galois::runtime::GlobalObject {
net.sendTagged(x, galois::runtime::evilPhase, std::move(b));
}

std::vector<std::vector<size_t>> delta_masters(numHosts);
// receive the mirror nodes
for (unsigned x = 0; x < numHosts; ++x) {
if (x == id)
Expand All @@ -363,35 +362,21 @@ class GluonSubstrate : public galois::runtime::GlobalObject {
do {
p = net.recieveTagged(galois::runtime::evilPhase);
} while (!p);

galois::runtime::gDeserialize(p->second, delta_masters[x]);
for (size_t i = 0; i < delta_masters[x].size(); ++i) {
(*masterNodes)[x].push_back(delta_masters[x][i]);
std::vector<size_t> delta_masters;
galois::runtime::gDeserialize(p->second, delta_masters);
for (size_t i = 0; i < delta_masters.size(); ++i) {
(*masterNodes)[p->first].push_back(delta_masters[i]);
}
}
incrementEvilPhase();
}

void addDeltaMirrors(std::vector<std::vector<size_t>>& delta_mirrors) {
for (size_t i = 0; i < delta_mirrors.size(); ++i) {
for (size_t j = 0; j < delta_mirrors[i].size(); ++j)
std::cout << "mirror " << delta_mirrors[i][j] << " host " << id
<< " i " << i << "\n";
}
std::vector<uint32_t> curr_mirrors_sizes(numHosts);
std::vector<uint32_t> curr_masters_sizes(numHosts);
for (uint32_t h = 0; h < numHosts; ++h) {
curr_mirrors_sizes[h] = (*mirrorNodes)[h].size();
curr_masters_sizes[h] = (*masterNodes)[h].size();
}
exchangeDeltaMirrors(delta_mirrors);
for (unsigned x = 0; x < numHosts; ++x) {
if (x == id)
continue;
for (size_t i = 0; i < delta_mirrors[x].size(); ++i) {
(*mirrorNodes)[x].push_back(delta_mirrors[x][i]);
}
}

// convert the global ids stored in the master/mirror nodes arrays to local
// ids
Expand All @@ -406,9 +391,9 @@ class GluonSubstrate : public galois::runtime::GlobalObject {
}

for (uint32_t h = 0; h < mirrorNodes->size(); ++h) {
size_t start = (*mirrorNodes)[h].size() - delta_mirrors[h].size();
galois::do_all(
galois::iterate(size_t{curr_mirrors_sizes[h]},
(*mirrorNodes)[h].size()),
galois::iterate(start, (*mirrorNodes)[h].size()),
[&](size_t n) {
(*mirrorNodes)[h][n] = userGraph.getLID((*mirrorNodes)[h][n]);
},
Expand Down

0 comments on commit 5835f9b

Please sign in to comment.