quantrs2_sim/scirs2_integration/
scirs2parallelcontext_traits.rs1use scirs2_core::parallel_ops::{
12 current_num_threads, IndexedParallelIterator, ParallelIterator, ThreadPool, ThreadPoolBuilder,
13};
14use scirs2_core::random::prelude::*;
15
16use super::types::SciRS2ParallelContext;
17
18impl Default for SciRS2ParallelContext {
19 fn default() -> Self {
20 let num_threads = current_num_threads();
21 let thread_pool = ThreadPoolBuilder::new()
22 .num_threads(num_threads)
23 .build()
24 .unwrap_or_else(|_| {
25 ThreadPoolBuilder::new()
26 .build()
27 .expect("fallback thread pool creation should succeed")
28 });
29 Self {
30 num_threads,
31 thread_pool,
32 numa_aware: true,
33 }
34 }
35}