Skip to content

Commit

Permalink
Attempting to solve affinity problems on CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Oct 12, 2017
1 parent d711115 commit d92ebd1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/runtime/threads/policies/affinity_data.cpp
Expand Up @@ -137,6 +137,8 @@ namespace hpx { namespace threads { namespace policies { namespace detail
hpx::util::safe_lexical_cast<std::size_t>(
get_config_entry("hpx.cores", 0), 0);

init_cached_pu_nums(num_system_pus);

#if defined(HPX_HAVE_HWLOC)
std::string affinity_desc;
hpx::detail::get_affinity_description(cfg_, affinity_desc);
Expand All @@ -145,7 +147,7 @@ namespace hpx { namespace threads { namespace policies { namespace detail
// don't use any affinity for any of the os-threads
threads::resize(no_affinity_, num_system_pus);
for (std::size_t i = 0; i != num_threads_; ++i)
threads::set(no_affinity_, i);
threads::set(no_affinity_, get_pu_num(i));
}
else if (!affinity_desc.empty())
{
Expand Down Expand Up @@ -186,7 +188,6 @@ namespace hpx { namespace threads { namespace policies { namespace detail
}

pu_offset_ %= num_system_pus;
init_cached_pu_nums(num_system_pus);

std::vector<std::size_t> cores;
cores.reserve(num_threads_);
Expand Down Expand Up @@ -320,7 +321,7 @@ namespace hpx { namespace threads { namespace policies { namespace detail

void affinity_data::init_cached_pu_nums(std::size_t hardware_concurrency)
{
if(pu_nums_.empty())
if (pu_nums_.empty())
{
pu_nums_.resize(num_threads_);
for (std::size_t i = 0; i != num_threads_; ++i)
Expand Down

0 comments on commit d92ebd1

Please sign in to comment.