Skip to content

Commit

Permalink
adapted code to changes in mona 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Jul 3, 2023
1 parent 21cefae commit 70ffe65
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ endif ()

# library version set here (e.g. for shared libs).
set (COLZA_VERSION_MAJOR 0)
set (COLZA_VERSION_MINOR 3)
set (COLZA_VERSION_MINOR 4)
set (COLZA_VERSION_PATCH 0)
set (COLZA_VERSION
"${COLZA_VERSION_MAJOR}.${COLZA_VERSION_MINOR}.${COLZA_VERSION_PATCH}")
Expand Down
2 changes: 1 addition & 1 deletion examples/distributed/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main(int argc, char** argv) {
mona_instance_t mona = mona_init_thread(g_address.c_str(), true, &hii.na_init_info, true);

// Print MoNA address for information
na_addr_t mona_addr;
mona_addr_t mona_addr;
mona_addr_self(mona, &mona_addr);
std::vector<char> mona_addr_buf(256);
size_t mona_addr_size = 256;
Expand Down
2 changes: 1 addition & 1 deletion examples/pipeline/DummyBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COLZA_REGISTER_BACKEND(dummy, DummyPipeline);

void DummyPipeline::updateMonaAddresses(
mona_instance_t mona,
const std::vector<na_addr_t>& addresses) {
const std::vector<mona_addr_t>& addresses) {
spdlog::trace("Mona addresses have been updated, group size is now {}", addresses.size());
(void)addresses;
(void)mona;
Expand Down
2 changes: 1 addition & 1 deletion examples/pipeline/DummyBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class DummyPipeline : public colza::Backend {
*/
void updateMonaAddresses(
mona_instance_t mona,
const std::vector<na_addr_t>& addresses) override;
const std::vector<mona_addr_t>& addresses) override;

/**
* @brief Tells the pipeline that the given iteration is starting.
Expand Down
2 changes: 1 addition & 1 deletion examples/single/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int main(int argc, char** argv) {
mona_instance_t mona = mona_init_thread(g_address.c_str(), true, NULL, true);

// Print MoNA address for information
na_addr_t mona_addr;
mona_addr_t mona_addr;
mona_addr_self(mona, &mona_addr);
std::vector<char> mona_addr_buf(256);
size_t mona_addr_size = 256;
Expand Down
2 changes: 1 addition & 1 deletion include/colza/Backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Backend {
*/
virtual void updateMonaAddresses(
mona_instance_t mona,
const std::vector<na_addr_t>& addresses) = 0;
const std::vector<mona_addr_t>& addresses) = 0;

/**
* @brief Tells the pipeline that the given iteration is starting.
Expand Down
16 changes: 8 additions & 8 deletions src/ProviderImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {
tl::condition_variable m_mona_cv;
mona_instance_t m_mona;
std::string m_mona_self_addr;
std::map<ssg_member_id_t, na_addr_t> m_mona_addresses;
std::map<ssg_member_id_t, mona_addr_t> m_mona_addresses;
// Admin RPC
tl::remote_procedure m_create_pipeline;
tl::remote_procedure m_destroy_pipeline;
Expand Down Expand Up @@ -130,7 +130,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {
spdlog::trace("[colza:{}] Group hash computed: {}", id(), m_group_hash);
{
std::lock_guard<tl::mutex> lock(m_mona_mtx);
na_addr_t my_mona_addr;
mona_addr_t my_mona_addr;
na_return_t ret = mona_addr_self(m_mona, &my_mona_addr);
if(ret != NA_SUCCESS)
throw Exception(ErrorCode::MONA_ERROR,
Expand Down Expand Up @@ -253,7 +253,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {
"Unknown pipeline type "s + type);
}

std::vector<na_addr_t> addresses;
std::vector<mona_addr_t> addresses;
{
std::lock_guard<tl::mutex> lock(m_mona_mtx);
addresses.reserve(m_mona_addresses.size());
Expand Down Expand Up @@ -582,7 +582,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {
req.respond(result);
}

na_addr_t _requestMonaAddressFromSSGMember(ssg_member_id_t member_id) {
mona_addr_t _requestMonaAddressFromSSGMember(ssg_member_id_t member_id) {
hg_addr_t hg_addr = HG_ADDR_NULL;
ssg_get_group_member_addr(m_gid, member_id, &hg_addr);
tl::provider_handle ph;
Expand All @@ -606,7 +606,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {
tl::thread::sleep(get_engine(), 100);
}
}
na_addr_t addr = NA_ADDR_NULL;
mona_addr_t addr = MONA_ADDR_NULL;
na_return_t ret = mona_addr_lookup(m_mona, result.value().c_str(), &addr);
if(ret != NA_SUCCESS)
throw Exception(ErrorCode::MONA_ERROR,
Expand Down Expand Up @@ -651,7 +651,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {
if(m_mona_addresses.count(member_id) != 0)
continue;
if(member_id == self_id) {
na_addr_t self_mona_addr;
mona_addr_t self_mona_addr;
mona_addr_self(m_mona, &self_mona_addr);
tmp_addresses[member_id] = self_mona_addr;
} else {
Expand All @@ -676,7 +676,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {

if(update_type == SSG_MEMBER_JOINED) {
spdlog::trace("[colza:{}] Member {} joined", id(), member_id);
na_addr_t na_addr = _requestMonaAddressFromSSGMember(member_id);
mona_addr_t na_addr = _requestMonaAddressFromSSGMember(member_id);
{
std::lock_guard<tl::mutex> lock(m_mona_mtx);
m_mona_addresses[member_id] = na_addr;
Expand All @@ -689,7 +689,7 @@ class ProviderImpl : public tl::provider<ProviderImpl> {
m_mona_addresses.erase(member_id);
}
}
std::vector<na_addr_t> addresses;
std::vector<mona_addr_t> addresses;
{
std::lock_guard<tl::mutex> lock(m_mona_mtx);
addresses.reserve(m_mona_addresses.size());
Expand Down

0 comments on commit 70ffe65

Please sign in to comment.