From 6e13b39c7fd8b5546eba94e6b9a0dd455720c729 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Tue, 6 Sep 2016 12:04:05 +0200 Subject: [PATCH 1/3] Fixing count for locality GID binding --- src/runtime/agas/addressing_service.cpp | 2 +- src/runtime/agas/server/locality_namespace_server.cpp | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/runtime/agas/addressing_service.cpp b/src/runtime/agas/addressing_service.cpp index 2afe443fc260..8749cf401844 100644 --- a/src/runtime/agas/addressing_service.cpp +++ b/src/runtime/agas/addressing_service.cpp @@ -241,7 +241,7 @@ void addressing_service::launch_bootstrap( std::uint32_t num_threads = hpx::util::get_entry_as( ini_, "hpx.os_threads", 1u); - locality_ns_->allocate(endpoints, 4, num_threads, naming::invalid_gid); + locality_ns_->allocate(endpoints, 0, num_threads, naming::invalid_gid); naming::gid_type runtime_support_gid1(here); runtime_support_gid1.set_lsb(rt.get_runtime_support_lva()); diff --git a/src/runtime/agas/server/locality_namespace_server.cpp b/src/runtime/agas/server/locality_namespace_server.cpp index f4c1365815c6..f922485d8bac 100644 --- a/src/runtime/agas/server/locality_namespace_server.cpp +++ b/src/runtime/agas/server/locality_namespace_server.cpp @@ -327,15 +327,12 @@ void locality_namespace::free(naming::gid_type locality) { l.unlock(); - std::uint32_t locality_id = - naming::get_locality_id_from_gid(locality); - // remove primary namespace { naming::gid_type service(HPX_AGAS_PRIMARY_NS_MSB, HPX_AGAS_PRIMARY_NS_LSB); primary_->unbind_gid( - 1, naming::replace_locality_id(service, locality_id)); + 1, naming::replace_locality_id(service, prefix)); } // remove symbol namespace @@ -343,7 +340,7 @@ void locality_namespace::free(naming::gid_type locality) naming::gid_type service(HPX_AGAS_SYMBOL_NS_MSB, HPX_AGAS_SYMBOL_NS_LSB); primary_->unbind_gid( - 1, naming::replace_locality_id(service, locality_id)); + 1, naming::replace_locality_id(service, prefix)); } // remove locality itself From 948291e4e796e3331f430e1d888486fce96cbe3e Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Tue, 6 Sep 2016 12:10:26 +0200 Subject: [PATCH 2/3] Fixing lock being held during suspension in parcel coalescing plugin --- plugins/parcel/coalescing/coalescing_message_handler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/parcel/coalescing/coalescing_message_handler.cpp b/plugins/parcel/coalescing/coalescing_message_handler.cpp index 48f44dac2ea3..3549407f6fc2 100644 --- a/plugins/parcel/coalescing/coalescing_message_handler.cpp +++ b/plugins/parcel/coalescing/coalescing_message_handler.cpp @@ -166,6 +166,7 @@ namespace hpx { namespace plugins { namespace parcel switch(s) { case detail::message_buffer::first_message: // start deadline timer to flush buffer + l.unlock(); timer_.start(interval); break; @@ -174,6 +175,7 @@ namespace hpx { namespace plugins { namespace parcel break; // start deadline timer to flush buffer + l.unlock(); timer_.start(interval); break; From 5a7ca931cbc66db73d987ff4d381a992885246fa Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Tue, 6 Sep 2016 17:24:01 +0200 Subject: [PATCH 3/3] Fixing id_type keep alive for async handle_managed_target kept the unmanaged id alive. It should keep the managed one alive. --- hpx/lcos/detail/async_implementations.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/hpx/lcos/detail/async_implementations.hpp b/hpx/lcos/detail/async_implementations.hpp index 008c27797d18..a7d54729a094 100644 --- a/hpx/lcos/detail/async_implementations.hpp +++ b/hpx/lcos/detail/async_implementations.hpp @@ -27,8 +27,8 @@ namespace hpx { namespace detail /////////////////////////////////////////////////////////////////////////// struct keep_id_alive { - explicit keep_id_alive(naming::id_type && id) - : id_(std::move(id)) + explicit keep_id_alive(naming::id_type const& id) + : id_(id) {} void operator()() const {} @@ -43,11 +43,11 @@ namespace hpx { namespace detail public: handle_managed_target(hpx::id_type const& id, future& f) - : target_is_managed_(false), unmanaged_id_(id), f_(f) + : target_is_managed_(false), id_(id), f_(f) { if (id.get_management_type() == naming::id_type::managed) { - id_ = naming::id_type(id.get_gid(), naming::id_type::unmanaged); + unmanaged_id_ = naming::id_type(id.get_gid(), naming::id_type::unmanaged); target_is_managed_ = true; } } @@ -67,20 +67,21 @@ namespace hpx { namespace detail if (state) { HPX_ASSERT(id_); + HPX_ASSERT(unmanaged_id_); state->set_on_completed( - hpx::detail::keep_id_alive(std::move(id_))); + hpx::detail::keep_id_alive(id_)); } } } hpx::id_type const& get_id() const { - return target_is_managed_ ? id_ : unmanaged_id_; + return target_is_managed_ ? unmanaged_id_ : id_; } bool target_is_managed_; - naming::id_type id_; - naming::id_type const& unmanaged_id_; + naming::id_type const& id_; + naming::id_type unmanaged_id_; future& f_; };