diff --git a/src/sysinfo.rs b/src/sysinfo.rs index fcd8bdd..05b9d23 100644 --- a/src/sysinfo.rs +++ b/src/sysinfo.rs @@ -47,19 +47,21 @@ impl SystemObject { // PUs per Package let puppa = coppa * pupco; // PUs per Machine - let available_hwthreads= papma * puppa; + let available_hwthreads = papma * puppa; // The cpu_bind_map can be instantiated using environment variables if desired. // Possible interesting improvement would be building a cpu_bind_map using a syntax like // OpenMP's OMP_PLACES. But that is outside of this project's scope due to difficulty of // writing a parser. - let cpu_bind_map= (0..available_hwthreads).map(|x| { - let package_id = x / puppa; - let package_offset = x % puppa; - let core_id = package_offset % coppa; - let core_offset = package_offset / coppa; - return puppa * package_id + core_id * pupco + core_offset; - }).collect::>(); + let cpu_bind_map = (0..available_hwthreads) + .map(|x| { + let package_id = x / puppa; + let package_offset = x % puppa; + let core_id = package_offset % coppa; + let core_offset = package_offset / coppa; + return puppa * package_id + core_id * pupco + core_offset; + }) + .collect::>(); let max_num_threads = max( option_env!("RMP_NUM_THREADS") diff --git a/src/threadpool.rs b/src/threadpool.rs index f846f70..637fb6d 100644 --- a/src/threadpool.rs +++ b/src/threadpool.rs @@ -119,7 +119,7 @@ impl ThreadPoolManager { /// long as the default Rust for loop accepts it. pub fn split_iterators(&self, iter: T, block_size: usize) -> Vec> where - T: Iterator + T: Iterator, { let mut split = Vec::new(); split.reserve_exact(self.num_threads);