Skip to content

Commit

Permalink
added an addresses array for MPI in jx9
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Aug 5, 2024
1 parent fb3432c commit 0169f1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Jx9Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ std::string Jx9Manager::executeQuery(
comm_world = json::object();
comm_world["rank"] = self->m_mpi.globalRank();
comm_world["size"] = self->m_mpi.globalSize();
comm_world["addresses"] = json::array();
for(int i = 0; i < self->m_mpi.globalSize(); ++i) {
comm_world["addresses"].push_back(
self->m_mpi.addressOfRank(i));
}
}
#endif
jx9_value* jx9_comm_world = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions src/MPIEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const std::string& MPIEnv::addressOfRank(int rank) const {
if(rank < 0 || rank >= globalSize()) {
throw Exception{"Requesting address of an invalid rank ({})", rank};
}
static const std::string uninitialized = "<uninitialized>";
if(self->m_addresses.empty()) return uninitialized;
return self->m_addresses[rank];
}

Expand Down

0 comments on commit 0169f1c

Please sign in to comment.