Skip to content

Commit

Permalink
common: disable numa control when not summing locally (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhuyb authored and ymjiang committed Nov 20, 2019
1 parent c1487f3 commit da1328d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions byteps/common/shared_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,26 @@ std::vector<void*> BytePSSharedMemory::openPcieSharedMemory(uint64_t key,
for (int i = 0; i < BytePSGlobal::GetPcieSwitchNum(); i++) {
auto prefix = std::string("BytePS_Pcie") + std::to_string(i) + "_Shm_";
if (BytePSGlobal::IsDistributed()) {
if (i <= numa_max_node()) {
numa_set_preferred(i);
if (BytePSGlobal::IsCrossPcieSwitch()) {
if (i <= numa_max_node()) {
numa_set_preferred(i);
r.push_back(openSharedMemory(prefix, key, size));
numa_set_preferred(-1);
} else {
numa_set_preferred(numa_max_node());
r.push_back(openSharedMemory(prefix, key, size));
numa_set_preferred(-1);
}
} else {
numa_set_preferred(numa_max_node());
r.push_back(openSharedMemory(prefix, key, size));
}
r.push_back(openSharedMemory(prefix, key, size));
numa_set_preferred(-1);
} else {
if (BytePSGlobal::IsCrossPcieSwitch()) {
numa_set_interleave_mask(numa_all_nodes_ptr);
r.push_back(openSharedMemory(prefix, key, size));
numa_set_interleave_mask(numa_no_nodes_ptr);
} else {
numa_set_preferred(0);
r.push_back(openSharedMemory(prefix, key, size));
numa_set_preferred(-1);
}
}
}
Expand Down

0 comments on commit da1328d

Please sign in to comment.