mirror of https://github.com/xythrez/RustMP.git
Cleanup and refactoring
This commit is contained in:
parent
e23b39ee41
commit
24c3772926
|
@ -53,13 +53,15 @@ impl SystemObject {
|
|||
// 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 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::<Vec<usize>>();
|
||||
})
|
||||
.collect::<Vec<usize>>();
|
||||
|
||||
let max_num_threads = max(
|
||||
option_env!("RMP_NUM_THREADS")
|
||||
|
|
|
@ -119,7 +119,7 @@ impl ThreadPoolManager {
|
|||
/// long as the default Rust for loop accepts it.
|
||||
pub fn split_iterators<T, S>(&self, iter: T, block_size: usize) -> Vec<Vec<S>>
|
||||
where
|
||||
T: Iterator<Item=S>
|
||||
T: Iterator<Item = S>,
|
||||
{
|
||||
let mut split = Vec::new();
|
||||
split.reserve_exact(self.num_threads);
|
||||
|
|
Loading…
Reference in New Issue