add num_threads back in too
This commit is contained in:
@@ -16,12 +16,18 @@ pub struct RunState {
|
|||||||
|
|
||||||
impl RunState {
|
impl RunState {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
#[cfg(feature = "parallel")]
|
||||||
|
let num_threads = num_cpus::get_physical();
|
||||||
|
|
||||||
|
#[cfg(feature = "parallel")]
|
||||||
|
let thread_pool = rapier::rayon::ThreadPoolBuilder::new()
|
||||||
|
.num_threads(num_threads)
|
||||||
|
.build()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
thread_pool: rapier::rayon::ThreadPoolBuilder::new()
|
thread_pool: thread_pool,
|
||||||
.num_threads(num_threads)
|
|
||||||
.build()
|
|
||||||
.unwrap(),
|
|
||||||
timestep_id: 0,
|
timestep_id: 0,
|
||||||
time: 0.0,
|
time: 0.0,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user