mirror of https://github.com/xythrez/RustMP.git
Hotfix: fixed thread pool size being determined at compile time
This commit is contained in:
parent
7de0994fde
commit
84845c0791
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue