Skip to content

Commit

Permalink
Use get_default_pool_name() internally for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
biddisco committed Oct 2, 2017
1 parent a328a77 commit 91fbdb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hpx/runtime/resource/detail/partitioner.hpp
Expand Up @@ -177,7 +177,7 @@ namespace hpx { namespace resource { namespace detail
initial_thread_pools_[0].pool_name_ = name;
}

const std::string &get_default_pool_name() {
const std::string &get_default_pool_name() const {
return initial_thread_pools_[0].pool_name_;
}

Expand Down
14 changes: 7 additions & 7 deletions src/runtime/resource/detail/detail_partitioner.cpp
Expand Up @@ -361,7 +361,7 @@ namespace hpx { namespace resource { namespace detail
// exclusively if dynamic pools are enabled.
// Also, by default, the first PU is always exclusive
// (to avoid deadlocks).
add_resource(p, initial_thread_pools_[0].pool_name_,
add_resource(p, get_default_pool_name(),
first || !(mode_ & mode_allow_dynamic_pools));
first = false;
}
Expand All @@ -372,11 +372,11 @@ namespace hpx { namespace resource { namespace detail
std::unique_lock<mutex_type> l(mtx_);

// @TODO allow empty pools
if (get_pool_data(initial_thread_pools_[0].pool_name_).num_threads_ == 0)
if (get_pool_data(get_default_pool_name()).num_threads_ == 0)
{
l.unlock();
throw_runtime_error("partitioner::setup_pools",
"Default pool " + initial_thread_pools_[0].pool_name_
"Default pool " + get_default_pool_name()
+ " has no threads assigned. Please rerun with "
"--hpx:threads=X and check the pool thread assignment");
}
Expand Down Expand Up @@ -548,10 +548,10 @@ namespace hpx { namespace resource { namespace detail

std::unique_lock<mutex_type> l(mtx_);

if (pool_name==initial_thread_pools_[0].pool_name_)
if (pool_name==get_default_pool_name())
{
initial_thread_pools_[0] = detail::init_pool_data(
initial_thread_pools_[0].pool_name_, sched);
get_default_pool_name(), sched);
return;
}

Expand Down Expand Up @@ -593,10 +593,10 @@ namespace hpx { namespace resource { namespace detail

std::unique_lock<mutex_type> l(mtx_);

if (pool_name==initial_thread_pools_[0].pool_name_)
if (pool_name==get_default_pool_name())
{
initial_thread_pools_[0] = detail::init_pool_data(
initial_thread_pools_[0].pool_name_, std::move(scheduler_creation));
get_default_pool_name(), std::move(scheduler_creation));
return;
}

Expand Down

0 comments on commit 91fbdb9

Please sign in to comment.