Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwloc-2.0: use hwloc_linux_read_path_as_cpumask() #576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions runtime/realm/threads.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1470,15 +1470,12 @@ namespace Realm {
std::set<int>& sibling_ids) {
char str[1024];
sprintf(str, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings", cpu_id);
FILE *f = fopen(str, "r");
if(!f) {
hwloc_bitmap_t set = hwloc_bitmap_alloc();

if (hwloc_linux_read_path_as_cpumask(str, set) < 0) {
log_thread.warning() << "can't read '" << str << "' - skipping";
return false;
}
hwloc_bitmap_t set = hwloc_bitmap_alloc();
hwloc_linux_parse_cpumap_file(f, set);

fclose(f);

// loop over all siblings (except ourselves)
for(int siblingid = hwloc_bitmap_first(set);
Expand Down