From 70ffe652d40b81e13ad76ee28bc12d6f6190e085 Mon Sep 17 00:00:00 2001 From: Matthieu Dorier Date: Mon, 3 Jul 2023 14:42:36 +0100 Subject: [PATCH] adapted code to changes in mona 0.3.0 --- CMakeLists.txt | 2 +- examples/distributed/server.cpp | 2 +- examples/pipeline/DummyBackend.cpp | 2 +- examples/pipeline/DummyBackend.hpp | 2 +- examples/single/server.cpp | 2 +- include/colza/Backend.hpp | 2 +- src/ProviderImpl.hpp | 16 ++++++++-------- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7f433c..63529f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/examples/distributed/server.cpp b/examples/distributed/server.cpp index 8f7736f..4ab4289 100644 --- a/examples/distributed/server.cpp +++ b/examples/distributed/server.cpp @@ -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 mona_addr_buf(256); size_t mona_addr_size = 256; diff --git a/examples/pipeline/DummyBackend.cpp b/examples/pipeline/DummyBackend.cpp index c346f8e..06afc5b 100644 --- a/examples/pipeline/DummyBackend.cpp +++ b/examples/pipeline/DummyBackend.cpp @@ -10,7 +10,7 @@ COLZA_REGISTER_BACKEND(dummy, DummyPipeline); void DummyPipeline::updateMonaAddresses( mona_instance_t mona, - const std::vector& addresses) { + const std::vector& addresses) { spdlog::trace("Mona addresses have been updated, group size is now {}", addresses.size()); (void)addresses; (void)mona; diff --git a/examples/pipeline/DummyBackend.hpp b/examples/pipeline/DummyBackend.hpp index a3757c2..3b80d1c 100644 --- a/examples/pipeline/DummyBackend.hpp +++ b/examples/pipeline/DummyBackend.hpp @@ -91,7 +91,7 @@ class DummyPipeline : public colza::Backend { */ void updateMonaAddresses( mona_instance_t mona, - const std::vector& addresses) override; + const std::vector& addresses) override; /** * @brief Tells the pipeline that the given iteration is starting. diff --git a/examples/single/server.cpp b/examples/single/server.cpp index 9228150..d16fba0 100644 --- a/examples/single/server.cpp +++ b/examples/single/server.cpp @@ -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 mona_addr_buf(256); size_t mona_addr_size = 256; diff --git a/include/colza/Backend.hpp b/include/colza/Backend.hpp index aa78dff..6a43e45 100644 --- a/include/colza/Backend.hpp +++ b/include/colza/Backend.hpp @@ -79,7 +79,7 @@ class Backend { */ virtual void updateMonaAddresses( mona_instance_t mona, - const std::vector& addresses) = 0; + const std::vector& addresses) = 0; /** * @brief Tells the pipeline that the given iteration is starting. diff --git a/src/ProviderImpl.hpp b/src/ProviderImpl.hpp index 1a0d605..b69f555 100644 --- a/src/ProviderImpl.hpp +++ b/src/ProviderImpl.hpp @@ -73,7 +73,7 @@ class ProviderImpl : public tl::provider { tl::condition_variable m_mona_cv; mona_instance_t m_mona; std::string m_mona_self_addr; - std::map m_mona_addresses; + std::map m_mona_addresses; // Admin RPC tl::remote_procedure m_create_pipeline; tl::remote_procedure m_destroy_pipeline; @@ -130,7 +130,7 @@ class ProviderImpl : public tl::provider { spdlog::trace("[colza:{}] Group hash computed: {}", id(), m_group_hash); { std::lock_guard 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, @@ -253,7 +253,7 @@ class ProviderImpl : public tl::provider { "Unknown pipeline type "s + type); } - std::vector addresses; + std::vector addresses; { std::lock_guard lock(m_mona_mtx); addresses.reserve(m_mona_addresses.size()); @@ -582,7 +582,7 @@ class ProviderImpl : public tl::provider { 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; @@ -606,7 +606,7 @@ class ProviderImpl : public tl::provider { 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, @@ -651,7 +651,7 @@ class ProviderImpl : public tl::provider { 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 { @@ -676,7 +676,7 @@ class ProviderImpl : public tl::provider { 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 lock(m_mona_mtx); m_mona_addresses[member_id] = na_addr; @@ -689,7 +689,7 @@ class ProviderImpl : public tl::provider { m_mona_addresses.erase(member_id); } } - std::vector addresses; + std::vector addresses; { std::lock_guard lock(m_mona_mtx); addresses.reserve(m_mona_addresses.size());