mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-02 17:05:33 +08:00
Merge branch 'branch-0.3.1' into 'branch-0.3.1'
MS-312 Set openmp thread number by config See merge request megasearch/milvus!314 Former-commit-id: 997cf27147e3b0ca24e28a37e92f814e604703ef
This commit is contained in:
commit
20a34eada9
@ -66,6 +66,12 @@ DBWrapper::DBWrapper() {
|
||||
if(omp_thread > 0) {
|
||||
omp_set_num_threads(omp_thread);
|
||||
SERVER_LOG_DEBUG << "Specify openmp thread number: " << omp_thread;
|
||||
} else {
|
||||
uint32_t sys_thread_cnt = 8;
|
||||
if(CommonUtil::GetSystemAvailableThreads(sys_thread_cnt)) {
|
||||
omp_thread = (int32_t)ceil(sys_thread_cnt*0.5);
|
||||
omp_set_num_threads(omp_thread);
|
||||
}
|
||||
}
|
||||
|
||||
//set archive config
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user