Skip to content

Commit

Permalink
This fixes CircleCI errors when running with --hpx:bind=none
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Oct 1, 2017
1 parent 2d680cc commit b9a346e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
12 changes: 7 additions & 5 deletions hpx/runtime/threads/policies/local_priority_queue_scheduler.hpp
Expand Up @@ -468,15 +468,17 @@ namespace hpx { namespace threads { namespace policies
num_thread %= queue_size;

// Select a OS thread which hasn't been disabled
while (true)
auto const& rp = resource::get_partitioner();
std::size_t count = queue_size;
while (count-- != 0)
{
auto const& rp = resource::get_partitioner();
auto mask = rp.get_pu_mask(
num_thread + parent_pool_->get_thread_offset());
if(bit_and(mask, parent_pool_->get_used_processing_units()))

if (bit_and(mask, parent_pool_->get_used_processing_units()))
break;
else
num_thread = (num_thread + 1) % queue_size;

num_thread = (num_thread + 1) % queue_size;
}

// now create the thread
Expand Down
12 changes: 7 additions & 5 deletions hpx/runtime/threads/policies/local_queue_scheduler.hpp
Expand Up @@ -312,15 +312,17 @@ namespace hpx { namespace threads { namespace policies
num_thread %= queue_size;

// Select a OS thread which hasn't been disabled
while (true)
auto const& rp = resource::get_partitioner();
std::size_t count = queue_size;
while (count-- != 0)
{
auto const& rp = resource::get_partitioner();
auto mask = rp.get_pu_mask(
num_thread + parent_pool_->get_thread_offset());
if(bit_and(mask, parent_pool_->get_used_processing_units()))

if (bit_and(mask, parent_pool_->get_used_processing_units()))
break;
else
num_thread = (num_thread + 1) % queue_size;

num_thread = (num_thread + 1) % queue_size;
}

HPX_ASSERT(num_thread < queue_size);
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/threads/policies/affinity_data.cpp
Expand Up @@ -208,7 +208,7 @@ namespace hpx { namespace threads { namespace policies { namespace detail
// --hpx:bind=none disables all affinity
if (threads::test(no_affinity_, global_thread_num))
{
static mask_type m = get_full_machine_mask(num_threads_);
static mask_type m = mask_type();
return m;
}

Expand Down

0 comments on commit b9a346e

Please sign in to comment.