add num_threads back in too

This commit is contained in:
rezural
2020-12-24 21:25:49 +11:00
parent 70d05cc63f
commit 975f0d149f

View File

@@ -16,12 +16,18 @@ pub struct RunState {
impl RunState { impl RunState {
pub fn new() -> Self { pub fn new() -> Self {
Self {
#[cfg(feature = "parallel")] #[cfg(feature = "parallel")]
thread_pool: rapier::rayon::ThreadPoolBuilder::new() let num_threads = num_cpus::get_physical();
#[cfg(feature = "parallel")]
let thread_pool = rapier::rayon::ThreadPoolBuilder::new()
.num_threads(num_threads) .num_threads(num_threads)
.build() .build()
.unwrap(), .unwrap();
Self {
#[cfg(feature = "parallel")]
thread_pool: thread_pool,
timestep_id: 0, timestep_id: 0,
time: 0.0, time: 0.0,
} }