Reduce thread contention in column split tests. (#10658)

---------

Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
Jiaming Yuan
2024-08-01 18:36:46 +08:00
committed by GitHub
parent 778751a1bb
commit 77c844cef7
8 changed files with 101 additions and 61 deletions

View File

@@ -186,6 +186,12 @@ void TestDistributedGlobal(std::int32_t n_workers, WorkerFn worker_fn, bool need
system::SocketFinalize();
}
inline std::int32_t GetWorkerLocalThreads(std::int32_t n_workers) {
std::int32_t n_total_threads = std::thread::hardware_concurrency();
auto n_threads = std::max(n_total_threads / n_workers, 1);
return n_threads;
}
class BaseMGPUTest : public ::testing::Test {
public:
/**