Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing gluon bugs for batched mirror exchange #55

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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