diff --git a/src/Jx9Manager.cpp b/src/Jx9Manager.cpp index c16f41d..944d481 100644 --- a/src/Jx9Manager.cpp +++ b/src/Jx9Manager.cpp @@ -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; diff --git a/src/MPIEnv.cpp b/src/MPIEnv.cpp index 76cd284..470be3a 100644 --- a/src/MPIEnv.cpp +++ b/src/MPIEnv.cpp @@ -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 = ""; + if(self->m_addresses.empty()) return uninitialized; return self->m_addresses[rank]; }