Skip to content

Commit

Permalink
Add get_pu_num to RP, maps from global thread Id to pu
Browse files Browse the repository at this point in the history
Flyby: Remove an unused vector and improve debug output
  • Loading branch information
biddisco committed Jul 28, 2017
1 parent 0827e4e commit 45fccbd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions hpx/runtime/resource_partitioner.hpp
Expand Up @@ -269,6 +269,7 @@ namespace resource {
size_t get_num_threads(std::size_t pool_index) const;
init_pool_data const& get_pool(std::size_t pool_index) const;
const std::string &get_pool_name(size_t index) const;
size_t get_pu_num(std::size_t global_thread_num);
threads::mask_cref_type get_pu_mask(
std::size_t num_thread, bool numa_sensitive) const;
bool cmd_line_parsed() const;
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/threads/policies/hwloc_topology_info.hpp
Expand Up @@ -272,7 +272,7 @@ namespace hpx { namespace threads
std::vector<std::size_t> socket_numbers_;
std::vector<std::size_t> numa_node_numbers_;
std::vector<std::size_t> core_numbers_;
std::vector<std::size_t> pu_numbers_; // (empty vector)
// std::vector<std::size_t> pu_numbers_; // (empty vector)

// Affinity masks: vectors of bitmasks
// - Length of the vector: number of PUs of the machine
Expand Down
9 changes: 7 additions & 2 deletions src/runtime/resource_partitioner.cpp
Expand Up @@ -790,10 +790,15 @@ namespace resource {
return initial_thread_pools_[index].pool_name_;
}

size_t resource_partitioner::get_pu_num(std::size_t global_thread_num)
{
return affinity_data_.get_pu_num(global_thread_num);
}

threads::mask_cref_type resource_partitioner::get_pu_mask(
std::size_t num_thread, bool numa_sensitive) const
std::size_t global_thread_num, bool numa_sensitive) const
{
return affinity_data_.get_pu_mask(num_thread, numa_sensitive);
return affinity_data_.get_pu_mask(global_thread_num, numa_sensitive);
}

bool resource_partitioner::cmd_line_parsed() const
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/threads/policies/hwloc_topology_info.cpp
Expand Up @@ -1147,7 +1147,7 @@ namespace hpx { namespace threads
os << v[0];
for (std::size_t i = 1; i != s; i++)
{
os << ", " << v[i];
os << ", " << std::dec << v[i];
}
os << "\n";
}
Expand Down Expand Up @@ -1187,8 +1187,8 @@ namespace hpx { namespace threads
print_vector(os, numa_node_numbers_);
os << "core : \n";
print_vector(os, core_numbers_);
os << "PUs (/threads) : \n";
print_vector(os, pu_numbers_);
//os << "PUs (/threads) : \n";
//print_vector(os, pu_numbers_);
}
}}

Expand Down

0 comments on commit 45fccbd

Please sign in to comment.