Hotfix: fixed thread pool size being determined at compile time

This commit is contained in:
Yiyao Yu 2021-05-04 20:33:45 -04:00
parent 7de0994fde
commit 84845c0791
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
use hwloc2::{CpuBindError, CpuBindFlags, ObjectType, Topology, TopologyObject}; use hwloc2::{CpuBindError, CpuBindFlags, ObjectType, Topology, TopologyObject};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::cmp::max; use std::cmp::max;
use std::env::var;
use std::sync::Arc; use std::sync::Arc;
lazy_static! { lazy_static! {
@ -64,8 +65,8 @@ impl SystemObject {
.collect::<Vec<usize>>(); .collect::<Vec<usize>>();
let max_num_threads = max( let max_num_threads = max(
option_env!("RMP_NUM_THREADS") var("RMP_NUM_THREADS")
.unwrap_or("") .unwrap_or("".to_string())
.parse::<usize>() .parse::<usize>()
.unwrap_or(available_hwthreads), .unwrap_or(available_hwthreads),
1, 1,