From d25ac6cfff18400f0b55a9372234e6b422ad1a67 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:51:41 +0200 Subject: [PATCH 01/17] fix clippy warnings in test --- fastiron-stats/Cargo.toml | 4 ++-- fastiron/tests/mc_vector.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fastiron-stats/Cargo.toml b/fastiron-stats/Cargo.toml index 01ee6e99..499601c3 100644 --- a/fastiron-stats/Cargo.toml +++ b/fastiron-stats/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = {version="4.3.5", features=["cargo", "derive"]} +clap = { version = "4.3.5", features = ["cargo", "derive"] } csv = "1.2.2" -gnuplot = "0.0.38" \ No newline at end of file +gnuplot = "0.0.38" diff --git a/fastiron/tests/mc_vector.rs b/fastiron/tests/mc_vector.rs index 60664e52..931404fc 100644 --- a/fastiron/tests/mc_vector.rs +++ b/fastiron/tests/mc_vector.rs @@ -162,7 +162,7 @@ fn div_assign_zero() { #[test] fn sum_owned() { - let vec = vec![ + let vec = [ MCVector { x: 2.0, y: 2.0, @@ -199,7 +199,7 @@ fn sum_owned() { #[test] fn sum_borrowed() { - let vec = vec![ + let vec = [ MCVector { x: 2.0, y: 2.0, From 8b98c6f2f6cb20fad06183c6e0856a69d89a64b3 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:55:08 +0200 Subject: [PATCH 02/17] Removed useless loop statement in main --- fastiron/src/main.rs | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/fastiron/src/main.rs b/fastiron/src/main.rs index bf4dd506..dcf9ef1c 100644 --- a/fastiron/src/main.rs +++ b/fastiron/src/main.rs @@ -281,25 +281,19 @@ pub fn cycle_process( mc_fast_timer::stop(&mut mcunit.fast_timer, Section::PopulationControl); mc_fast_timer::start(&mut mcunit.fast_timer, Section::CycleTracking); - loop { - while !container.is_done_processing() { - // sort particles - mc_fast_timer::start(&mut mcunit.fast_timer, Section::CycleTrackingSort); - container.sort_processing(); - mc_fast_timer::stop(&mut mcunit.fast_timer, Section::CycleTrackingSort); - - // track particles - mc_fast_timer::start(&mut mcunit.fast_timer, Section::CycleTrackingProcess); - container.process_particles(mcdata, mcunit); - mc_fast_timer::stop(&mut mcunit.fast_timer, Section::CycleTrackingProcess); - - // clean extra here - container.clean_extra_vaults(); - } - - if container.is_done_processing() { - break; - } + while !container.is_done_processing() { + // sort particles + mc_fast_timer::start(&mut mcunit.fast_timer, Section::CycleTrackingSort); + container.sort_processing(); + mc_fast_timer::stop(&mut mcunit.fast_timer, Section::CycleTrackingSort); + + // track particles + mc_fast_timer::start(&mut mcunit.fast_timer, Section::CycleTrackingProcess); + container.process_particles(mcdata, mcunit); + mc_fast_timer::stop(&mut mcunit.fast_timer, Section::CycleTrackingProcess); + + // clean extra here + container.clean_extra_vaults(); } mc_fast_timer::stop(&mut mcunit.fast_timer, Section::CycleTracking); From 8ddbd3b182dc04a9783779919049bcc9ede4bef1 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:29:43 +0200 Subject: [PATCH 03/17] highlight code with poor memory usage --- fastiron/src/geometry/mesh_partition.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fastiron/src/geometry/mesh_partition.rs b/fastiron/src/geometry/mesh_partition.rs index f582ecf4..3e69ab10 100644 --- a/fastiron/src/geometry/mesh_partition.rs +++ b/fastiron/src/geometry/mesh_partition.rs @@ -111,10 +111,12 @@ impl MeshPartition { let mut n_local_cells: usize = 0; + // TWICE THE MEMORY let read_map = self.cell_info_map.clone(); for (cell_gid, cell_info) in &mut self.cell_info_map { let domain_gid: usize = cell_info.domain_gid.unwrap(); + // Always true when not distributed if domain_gid == self.domain_gid { // local cell cell_info.cell_index = Some(n_local_cells); @@ -122,8 +124,10 @@ impl MeshPartition { cell_info.domain_index = Some(self.domain_gid); cell_info.foreman = Some(self.foreman); } else { + // THIS IS THE PART THAT USES TWICE THE MEMORY + // WILL REMOVE WHEN REMOVING ALL TRACES OF DISTRIBUTED IMPLEMENTATION + println!("test"); let face_nbr = grid.get_face_nbr_gids(*cell_gid); - for j_cell_gid in face_nbr { if let Some(c_info) = read_map.get(&j_cell_gid) { if c_info.domain_gid != Some(self.domain_gid) { From a0f1cfab1e2b96ccbcb62dc46e1243f5eb8a791d Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Mon, 18 Sep 2023 11:55:26 +0200 Subject: [PATCH 04/17] change in snap turtle implem Now uses clamp() method; no perf diff but readability increased --- fastiron/Cargo.toml | 26 ++++--- fastiron/benches/snap_turtle.rs | 87 ++++++++++++++++++++++++ fastiron/src/geometry/global_fcc_grid.rs | 6 +- 3 files changed, 105 insertions(+), 14 deletions(-) create mode 100644 fastiron/benches/snap_turtle.rs diff --git a/fastiron/Cargo.toml b/fastiron/Cargo.toml index 64902889..2929a36c 100644 --- a/fastiron/Cargo.toml +++ b/fastiron/Cargo.toml @@ -6,19 +6,19 @@ edition = "2021" # DEPENDENCIES [dependencies] -clap = {version="4.3.5", features=["cargo", "derive"]} -serde_yaml = {version="0.9.21", features=[]} -num = {version="0.4.0"} -rand = {version="0.8.5", features=["small_rng"]} -tinyvec = {version="1.6.0"} -rayon= {version="1.7.0"} -atomic = {version="0.5.3"} -hwloc2 = {version="2.2.0"} -libc = {version="0.2.146"} -rustc-hash = {version="1.1.0"} +clap = { version = "4.3.5", features = ["cargo", "derive"] } +serde_yaml = { version = "0.9.21", features = [] } +num = { version = "0.4.0" } +rand = { version = "0.8.5", features = ["small_rng"] } +tinyvec = { version = "1.6.0" } +rayon = { version = "1.7.0" } +atomic = { version = "0.5.3" } +hwloc2 = { version = "2.2.0" } +libc = { version = "0.2.146" } +rustc-hash = { version = "1.1.0" } [dev-dependencies] -criterion = {version="0.5.1", features=["html_reports"]} +criterion = { version = "0.5.1", features = ["html_reports"] } # FEATURES [features] @@ -33,3 +33,7 @@ harness = false [[bench]] name = "mct_cross_product" harness = false + +[[bench]] +name = "snap_turtle" +harness = false diff --git a/fastiron/benches/snap_turtle.rs b/fastiron/benches/snap_turtle.rs new file mode 100644 index 00000000..1e34e96e --- /dev/null +++ b/fastiron/benches/snap_turtle.rs @@ -0,0 +1,87 @@ +use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; +use fastiron::constants::Tuple3; + +// Define the routines that are tested + +fn manual_snap(times: usize) { + let bounds: (usize, usize, usize) = (10, 10, 10); + fn snap(bounds: (usize, usize, usize), tt: (i32, i32, i32)) -> Tuple3 { + ( + (tt.0.max(0) as usize).min(bounds.0 - 1), + (tt.1.max(0) as usize).min(bounds.1 - 1), + (tt.2.max(0) as usize).min(bounds.2 - 1), + ) + } + let tt1 = (1, 3, 2); // nothing to snap + let tt2 = (-1, 3, 2); // 1 element + let tt3 = (-1, 11, 2); // 2 elements + let tt4 = (-1, 11, -1); // 3 elements + (0..times).for_each(|_| { + let res = snap(bounds, tt1); + black_box(res); + }); + (0..times).for_each(|_| { + let res = snap(bounds, tt2); + black_box(res); + }); + (0..times).for_each(|_| { + let res = snap(bounds, tt3); + black_box(res); + }); + (0..times).for_each(|_| { + let res = snap(bounds, tt4); + black_box(res); + }); +} + +fn clamp_snap(times: usize) { + let bounds: (usize, usize, usize) = (10, 10, 10); + fn snap(bounds: (usize, usize, usize), tt: (i32, i32, i32)) -> Tuple3 { + ( + tt.0.clamp(0, (bounds.0 - 1) as i32) as usize, + tt.1.clamp(0, (bounds.1 - 1) as i32) as usize, + tt.2.clamp(0, (bounds.2 - 1) as i32) as usize, + ) + } + let tt1 = (1, 3, 2); // nothing to snap + let tt2 = (-1, 3, 2); // 1 element + let tt3 = (-1, 11, 2); // 2 elements + let tt4 = (-1, 11, -1); // 3 elements + (0..times).for_each(|_| { + let res = snap(bounds, tt1); + black_box(res); + }); + (0..times).for_each(|_| { + let res = snap(bounds, tt2); + black_box(res); + }); + (0..times).for_each(|_| { + let res = snap(bounds, tt3); + black_box(res); + }); + (0..times).for_each(|_| { + let res = snap(bounds, tt4); + black_box(res); + }); +} + +pub fn criterion_benchmark(c: &mut Criterion) { + // Generate/Define the input + let n_iter: usize = 1000; + + let mut group = c.benchmark_group("snap turtle implementation"); + group.bench_with_input( + BenchmarkId::new("manual snap", "number of iterations/4"), + &n_iter, + |b, &n| b.iter(|| manual_snap(n)), + ); + group.bench_with_input( + BenchmarkId::new("clamp snap", "number of iterations/4"), + &n_iter, + |b, &n| b.iter(|| clamp_snap(n)), + ); + group.finish(); +} + +criterion_group!(benches, criterion_benchmark); +criterion_main!(benches); diff --git a/fastiron/src/geometry/global_fcc_grid.rs b/fastiron/src/geometry/global_fcc_grid.rs index 5005d4da..9a2f2621 100644 --- a/fastiron/src/geometry/global_fcc_grid.rs +++ b/fastiron/src/geometry/global_fcc_grid.rs @@ -189,9 +189,9 @@ impl GlobalFccGrid { pub fn snap_turtle(&self, tt: (i32, i32, i32)) -> Tuple3 { // set tt such that (0 <= tt.* < n*) ( - (tt.0.max(0) as usize).min(self.nx - 1), - (tt.1.max(0) as usize).min(self.ny - 1), - (tt.2.max(0) as usize).min(self.nz - 1), + tt.0.clamp(0, (self.nx - 1) as i32) as usize, + tt.1.clamp(0, (self.ny - 1) as i32) as usize, + tt.2.clamp(0, (self.nz - 1) as i32) as usize, ) } } From 2da117bff24a63db0cb89e7f498100315d58e902 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:09:52 +0200 Subject: [PATCH 05/17] added check for particle density --- fastiron/src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fastiron/src/main.rs b/fastiron/src/main.rs index dcf9ef1c..2aa19c87 100644 --- a/fastiron/src/main.rs +++ b/fastiron/src/main.rs @@ -40,6 +40,15 @@ fn main() { let params: Parameters = Parameters::get_parameters(cli).unwrap(); println!("[Simulation Parameters]\n{:#?}", params.simulation_params); + let n_cells_tot = + params.simulation_params.nx * params.simulation_params.ny * params.simulation_params.nz; + + if params.simulation_params.n_particles as usize / n_cells_tot < 10 { + println!("[ERROR] TOO FEW PARTICLES PER CELL OVERALL"); + println!("[ERROR] Need at least 10 particles per cell of the mesh overall"); + return; + } + //=============== // Initialization //=============== From 592352b410c3d7bacfe3646e5ccc4c97f04ab437 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:32:57 +0100 Subject: [PATCH 06/17] better MCGeneralPlane constructor --- fastiron/src/geometry/facets.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fastiron/src/geometry/facets.rs b/fastiron/src/geometry/facets.rs index ece18b34..bcf57dbc 100644 --- a/fastiron/src/geometry/facets.rs +++ b/fastiron/src/geometry/facets.rs @@ -32,21 +32,20 @@ impl MCGeneralPlane { pub fn new(points: &[MCVector]) -> Self { let one: T = one(); assert_eq!(points.len(), 3); - let r0 = points[0]; - let r1 = points[1]; - let r2 = points[2]; + let (r0, r1, r2) = (points[0], points[1], points[2]); let mut a = ((r1.y - r0.y) * (r2.z - r0.z)) - ((r1.z - r0.z) * (r2.y - r0.y)); let mut b = ((r1.z - r0.z) * (r2.x - r0.x)) - ((r1.x - r0.x) * (r2.z - r0.z)); let mut c = ((r1.x - r0.x) * (r2.y - r0.y)) - ((r1.y - r0.y) * (r2.x - r0.x)); let mut d = -one * (a * r0.x + b * r0.y + c * r0.z); - let mut magnitude: T = (a * a + b * b + c * c).sqrt(); + let magnitude: T = (a * a + b * b + c * c).sqrt(); // if magnitude == 0 if magnitude == zero() { a = one; - magnitude = one; + // early return should prevent fp error + return Self { a, b, c, d }; } // normalize a /= magnitude; From b62e0284c1da02f995c3c4b1bd426bab6b9cb839 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:40:12 +0100 Subject: [PATCH 07/17] moved mc_vector tests back to the src file --- fastiron/src/data/mc_vector.rs | 321 ++++++++++++++++++++++++++++++++ fastiron/tests/mc_vector.rs | 324 --------------------------------- 2 files changed, 321 insertions(+), 324 deletions(-) delete mode 100644 fastiron/tests/mc_vector.rs diff --git a/fastiron/src/data/mc_vector.rs b/fastiron/src/data/mc_vector.rs index 7c049d5e..855d5959 100644 --- a/fastiron/src/data/mc_vector.rs +++ b/fastiron/src/data/mc_vector.rs @@ -34,6 +34,7 @@ pub struct MCVector { } impl MCVector { + #[cfg(any(test, doc))] /// Returns true if the vector is almost the zero element. This method is /// necessary because of floating-point errors. pub fn is_almost_zero(&self) -> bool { @@ -41,6 +42,7 @@ impl MCVector { (self.x.abs() < threshold) & (self.y.abs() < threshold) & (self.z.abs() < threshold) } + #[cfg(any(test, doc))] /// Returns true if the vectors are almost equal. This method is /// necessary because of floating-point errors. pub fn is_almost_equal(&self, vv: &MCVector) -> bool { @@ -158,3 +160,322 @@ impl core::ops::DivAssign for MCVector { self.z /= f; } } + +#[cfg(test)] +mod test { + use super::*; + use num::Float; + + #[test] + fn add() { + let uu = MCVector { + x: 1.0 / 3.0, + y: 1.0343253253254332 / 3.0, + z: -1.0 / 3.0, + }; + let vv = MCVector { + x: 2.0 / 3.0, + y: 31.0 / 3.0, + z: 2.0 / 3.0, + }; + let ww = MCVector { + x: 1.0, + y: 32.03432532532543 / 3.0, + z: 1.0 / 3.0, + }; + assert_eq!(uu + vv, ww); + } + + #[test] + fn add_assign() { + let mut uu = MCVector { + x: 1.0 / 3.0, + y: 1.0343253253254332 / 3.0, + z: -1.0 / 3.0, + }; + let vv = MCVector { + x: 2.0 / 3.0, + y: 31.0 / 3.0, + z: 2.0 / 3.0, + }; + let ww = MCVector { + x: 1.0, + y: 32.03432532532543 / 3.0, + z: 1.0 / 3.0, + }; + uu += vv; + assert_eq!(uu, ww); + } + + #[test] + fn sub() { + let uu = MCVector { + x: 1.0 / 3.0, + y: 1.0343253253254332, + z: 1.0 / 3.0, + }; + let vv = MCVector { + x: 2.0 / 3.0, + y: 31.0, + z: -2.0 / 3.0, + }; + // Exact equality work in this case, but this isn't + // consistent. For example, dividing by 3 all y coords + // will make it fail because of error propagation. + let ww = MCVector { + x: -1.0 / 3.0, + //y: -29.9656746746745668, + //y: -29.965674674674566, + y: -29.965674674674567, + z: 1.0, + }; + assert_eq!(uu - vv, ww); + } + + #[test] + fn sub_assign() { + let mut uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let vv = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let ww = MCVector { + x: 0.0, + y: 0.0, + z: 0.0, + }; + uu -= vv; + assert_eq!(uu, ww); + } + + #[test] + fn mul() { + let uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let f = 2.0; + let ww = MCVector { + x: 2.0, + y: 2.0, + z: 2.0, + }; + assert_eq!(uu * f, ww); + } + + #[test] + fn mul_assign() { + let mut uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let f = 2.0; + let ww = MCVector { + x: 2.0, + y: 2.0, + z: 2.0, + }; + uu *= f; + assert_eq!(uu, ww); + } + + #[test] + fn div_assign() { + let mut uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let f = 2.0; + let ww = MCVector { + x: 0.5, + y: 0.5, + z: 0.5, + }; + uu /= f; + assert_eq!(uu, ww); + } + + #[test] + #[should_panic] + fn div_assign_zero() { + let mut uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + uu /= 0.0; + } + + // Sums + + #[test] + fn sum_owned() { + let vec = [ + MCVector { + x: 2.0, + y: 2.0, + z: 2.0, + }, + MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }, + MCVector { + x: 0.5, + y: 0.5, + z: 0.5, + }, + MCVector { + x: 0.5, + y: 0.5, + z: 0.5, + }, + ]; + + let res: MCVector = vec.iter().copied().sum(); + + assert_eq!( + res, + MCVector { + x: 4.0, + y: 4.0, + z: 4.0 + } + ) + } + + #[test] + fn sum_borrowed() { + let vec = [ + MCVector { + x: 2.0, + y: 2.0, + z: 2.0, + }, + MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }, + MCVector { + x: 0.5, + y: 0.5, + z: 0.5, + }, + MCVector { + x: 0.5, + y: 0.5, + z: 0.5, + }, + ]; + + let res: MCVector = vec.iter().sum(); + + assert_eq!( + res, + MCVector { + x: 4.0, + y: 4.0, + z: 4.0 + } + ) + } + + // Pushing the boundaries + + #[test] + fn floating_point_error() { + let uu = MCVector { + x: 1.0 / 3.0, + y: 1.0343253253254332 / 3.0, + z: 1.0 / 3.0, + }; + let vv = MCVector { + x: 2.0 / 3.0, + y: 31.0 / 3.0, + z: -2.0 / 3.0, + }; + let ww = MCVector { + x: -1.0 / 3.0, + //y: -29.9656746746745668/3.0, // error with exact value + //y: -29.965674674674566/3.0, // error with truncated value + y: -29.965674674674567 / 3.0, // error with rounded value + z: 1.0, + }; + // instead of checking for exact equality, we check that the + // difference is close enough to zero + assert!((uu - vv).is_almost_equal(&ww)); + } + + // Methods + + #[test] + fn length() { + // trivial case + let mut uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + assert_eq!(uu.length(), 3.0.sqrt()); + + // negative & non rational coordinates + uu.x = -1.0; + uu.y = 23.0.sqrt(); + assert_eq!(uu.length(), 5.0); + } + + #[test] + fn distance() { + let uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let ww = MCVector { + x: 2.0, + y: 2.0, + z: 2.0, + }; + assert_eq!(uu.distance(&ww), 3.0.sqrt()); + } + + #[test] + fn dot_product() { + let uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let ww = MCVector { + x: 2.0, + y: 2.0, + z: 2.0, + }; + assert_eq!(uu.dot(&ww), 6.0); + } + + #[test] + fn cross_product() { + let uu = MCVector { + x: 1.0, + y: 1.0, + z: 1.0, + }; + let ww = MCVector { + x: 2.0, + y: 2.0, + z: 2.0, + }; + assert_eq!(uu.cross(&ww), MCVector::default()); // default is the zero element + } +} diff --git a/fastiron/tests/mc_vector.rs b/fastiron/tests/mc_vector.rs deleted file mode 100644 index 931404fc..00000000 --- a/fastiron/tests/mc_vector.rs +++ /dev/null @@ -1,324 +0,0 @@ -// Testing for correct results -// Benchmarking is done using criterion - -// What to look for in those tests: floating-point errors. -// We might need to use an approximative equality test such as -// a == b <=> (a-b) < smallnumber - -use fastiron::data::mc_vector::MCVector; -use num::Float; - -// Basic operations - -#[test] -fn add() { - let uu = MCVector { - x: 1.0 / 3.0, - y: 1.0343253253254332 / 3.0, - z: -1.0 / 3.0, - }; - let vv = MCVector { - x: 2.0 / 3.0, - y: 31.0 / 3.0, - z: 2.0 / 3.0, - }; - let ww = MCVector { - x: 1.0, - y: 32.03432532532543 / 3.0, - z: 1.0 / 3.0, - }; - assert_eq!(uu + vv, ww); -} - -#[test] -fn add_assign() { - let mut uu = MCVector { - x: 1.0 / 3.0, - y: 1.0343253253254332 / 3.0, - z: -1.0 / 3.0, - }; - let vv = MCVector { - x: 2.0 / 3.0, - y: 31.0 / 3.0, - z: 2.0 / 3.0, - }; - let ww = MCVector { - x: 1.0, - y: 32.03432532532543 / 3.0, - z: 1.0 / 3.0, - }; - uu += vv; - assert_eq!(uu, ww); -} - -#[test] -fn sub() { - let uu = MCVector { - x: 1.0 / 3.0, - y: 1.0343253253254332, - z: 1.0 / 3.0, - }; - let vv = MCVector { - x: 2.0 / 3.0, - y: 31.0, - z: -2.0 / 3.0, - }; - // Exact equality work in this case, but this isn't - // consistent. For example, dividing by 3 all y coords - // will make it fail because of error propagation. - let ww = MCVector { - x: -1.0 / 3.0, - //y: -29.9656746746745668, - //y: -29.965674674674566, - y: -29.965674674674567, - z: 1.0, - }; - assert_eq!(uu - vv, ww); -} - -#[test] -fn sub_assign() { - let mut uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let vv = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let ww = MCVector { - x: 0.0, - y: 0.0, - z: 0.0, - }; - uu -= vv; - assert_eq!(uu, ww); -} - -#[test] -fn mul() { - let uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let f = 2.0; - let ww = MCVector { - x: 2.0, - y: 2.0, - z: 2.0, - }; - assert_eq!(uu * f, ww); -} - -#[test] -fn mul_assign() { - let mut uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let f = 2.0; - let ww = MCVector { - x: 2.0, - y: 2.0, - z: 2.0, - }; - uu *= f; - assert_eq!(uu, ww); -} - -#[test] -fn div_assign() { - let mut uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let f = 2.0; - let ww = MCVector { - x: 0.5, - y: 0.5, - z: 0.5, - }; - uu /= f; - assert_eq!(uu, ww); -} - -#[test] -#[should_panic] -fn div_assign_zero() { - let mut uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - uu /= 0.0; -} - -// Sums - -#[test] -fn sum_owned() { - let vec = [ - MCVector { - x: 2.0, - y: 2.0, - z: 2.0, - }, - MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }, - MCVector { - x: 0.5, - y: 0.5, - z: 0.5, - }, - MCVector { - x: 0.5, - y: 0.5, - z: 0.5, - }, - ]; - - let res: MCVector = vec.iter().copied().sum(); - - assert_eq!( - res, - MCVector { - x: 4.0, - y: 4.0, - z: 4.0 - } - ) -} - -#[test] -fn sum_borrowed() { - let vec = [ - MCVector { - x: 2.0, - y: 2.0, - z: 2.0, - }, - MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }, - MCVector { - x: 0.5, - y: 0.5, - z: 0.5, - }, - MCVector { - x: 0.5, - y: 0.5, - z: 0.5, - }, - ]; - - let res: MCVector = vec.iter().sum(); - - assert_eq!( - res, - MCVector { - x: 4.0, - y: 4.0, - z: 4.0 - } - ) -} - -// Pushing the boundaries - -#[test] -fn floating_point_error() { - let uu = MCVector { - x: 1.0 / 3.0, - y: 1.0343253253254332 / 3.0, - z: 1.0 / 3.0, - }; - let vv = MCVector { - x: 2.0 / 3.0, - y: 31.0 / 3.0, - z: -2.0 / 3.0, - }; - let ww = MCVector { - x: -1.0 / 3.0, - //y: -29.9656746746745668/3.0, // error with exact value - //y: -29.965674674674566/3.0, // error with truncated value - y: -29.965674674674567 / 3.0, // error with rounded value - z: 1.0, - }; - // instead of checking for exact equality, we check that the - // difference is close enough to zero - assert!((uu - vv).is_almost_equal(&ww)); -} - -// Methods - -#[test] -fn length() { - // trivial case - let mut uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - assert_eq!(uu.length(), 3.0.sqrt()); - - // negative & non rational coordinates - uu.x = -1.0; - uu.y = 23.0.sqrt(); - assert_eq!(uu.length(), 5.0); -} - -#[test] -fn distance() { - let uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let ww = MCVector { - x: 2.0, - y: 2.0, - z: 2.0, - }; - assert_eq!(uu.distance(&ww), 3.0.sqrt()); -} - -#[test] -fn dot_product() { - let uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let ww = MCVector { - x: 2.0, - y: 2.0, - z: 2.0, - }; - assert_eq!(uu.dot(&ww), 6.0); -} - -#[test] -fn cross_product() { - let uu = MCVector { - x: 1.0, - y: 1.0, - z: 1.0, - }; - let ww = MCVector { - x: 2.0, - y: 2.0, - z: 2.0, - }; - assert_eq!(uu.cross(&ww), MCVector::default()); // default is the zero element -} From f55dda3d9a837b6357301f566405ab0ca2e5e14c Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:50:24 +0100 Subject: [PATCH 08/17] removed dead code & simplified get_total_cross_section method --- fastiron/src/data/nuclear_data.rs | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/fastiron/src/data/nuclear_data.rs b/fastiron/src/data/nuclear_data.rs index fb1623e1..70cd9a60 100644 --- a/fastiron/src/data/nuclear_data.rs +++ b/fastiron/src/data/nuclear_data.rs @@ -283,30 +283,13 @@ impl NuclearData { low } - /// Returns the number of reactions for a given isotope. - pub fn get_number_reactions(&self, isotope_index: usize) -> usize { - self.isotopes[isotope_index][0].reactions.len() - } - /// Returns the total cross section for a given energy group. pub fn get_total_cross_section(&self, isotope_index: usize, group: usize) -> T { - let num_reactions = self.isotopes[isotope_index][0].reactions.len(); - let mut total_xsection: T = zero(); - - (0..num_reactions).for_each(|r_idx| { - total_xsection += self.isotopes[isotope_index][0].reactions[r_idx].cross_section[group]; - }); - - total_xsection - } - - /// Returns the reaction-specific cross section for a given energy group. - pub fn get_reaction_cross_section( - &self, - react_index: usize, - isotope_index: usize, - group: usize, - ) -> T { - self.isotopes[isotope_index][0].reactions[react_index].cross_section[group] + // sum all reaction's xsection for a given isotope at a given energy level + self.isotopes[isotope_index][0] + .reactions + .iter() + .map(|reaction| reaction.cross_section[group]) + .sum() } } From 607332257d5982132a4be54bf73c3dba19350fb1 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:58:10 +0100 Subject: [PATCH 09/17] small changes in tallies mod --- fastiron/src/data/tallies.rs | 15 ++++++++------- fastiron/src/utils/coral_benchmark_correctness.rs | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fastiron/src/data/tallies.rs b/fastiron/src/data/tallies.rs index a9e0dd18..0278781b 100644 --- a/fastiron/src/data/tallies.rs +++ b/fastiron/src/data/tallies.rs @@ -65,10 +65,6 @@ impl FluenceDomain { *fl_cell += sum; }) } - - pub fn size(&self) -> usize { - self.cell.len() - } } //======== @@ -127,13 +123,17 @@ impl Index for Balance { type Output = u64; fn index(&self, index: TalliedEvent) -> &Self::Output { - &self.data[index as usize] + let idx = index as usize; + assert!(idx < self.data.len()); + &self.data[idx] } } impl IndexMut for Balance { fn index_mut(&mut self, index: TalliedEvent) -> &mut Self::Output { - &mut self.data[index as usize] + let idx = index as usize; + assert!(idx < self.data.len()); + &mut self.data[idx] } } @@ -184,17 +184,18 @@ impl ScalarFluxDomain { } } -// maybe make theses accesses unchecked? impl Index<(usize, usize)> for ScalarFluxDomain { type Output = Atomic; fn index(&self, index: (usize, usize)) -> &Self::Output { + assert!(index.0 * self.num_groups + index.1 < self.cell.len()); &self.cell[index.0 * self.num_groups + index.1] } } impl IndexMut<(usize, usize)> for ScalarFluxDomain { fn index_mut(&mut self, index: (usize, usize)) -> &mut Self::Output { + assert!(index.0 * self.num_groups + index.1 < self.cell.len()); &mut self.cell[index.0 * self.num_groups + index.1] } } diff --git a/fastiron/src/utils/coral_benchmark_correctness.rs b/fastiron/src/utils/coral_benchmark_correctness.rs index 8bc24047..00654d8e 100644 --- a/fastiron/src/utils/coral_benchmark_correctness.rs +++ b/fastiron/src/utils/coral_benchmark_correctness.rs @@ -154,7 +154,7 @@ pub fn fluence_test(mcresults: &MonteCarloResults) { .iter() .for_each(|val| local_sum += *val); - let average: T = local_sum / FromPrimitive::from_usize(mcresults.fluence.size()).unwrap(); + let average: T = local_sum / FromPrimitive::from_usize(mcresults.fluence.cell.len()).unwrap(); mcresults.fluence.cell.iter().for_each(|cell_value| { let percent_diff: T = (*cell_value - average).abs() / ((*cell_value + average) / FromPrimitive::from_f64(2.0).unwrap()) From be473850a3202e4519ee19487b1b16bb2c5a9518 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Fri, 2 Feb 2024 20:56:19 +0100 Subject: [PATCH 10/17] removed misc test those did not concern fastiron, just verification of how Rust works --- fastiron/tests/misc.rs | 54 ------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 fastiron/tests/misc.rs diff --git a/fastiron/tests/misc.rs b/fastiron/tests/misc.rs deleted file mode 100644 index ce196c1b..00000000 --- a/fastiron/tests/misc.rs +++ /dev/null @@ -1,54 +0,0 @@ -use std::hint::black_box; - -use num::{Float, ToPrimitive}; -use rustc_hash::FxHashMap; - -#[test] -fn map_behavior() { - let mut map: FxHashMap = Default::default(); - let mut complementary_map: FxHashMap = Default::default(); - (0..10).for_each(|jj| { - (0..5).for_each(|ii| { - map.insert(jj * 12 + ii, jj * 12 + ii); - }); - (5..12).for_each(|ii| { - complementary_map.insert(jj * 12 + ii, jj * 12 + ii); - }); - //assert_eq!(map.len(), 5); - //assert_eq!(complementary_map.len(), 7); - }); - - map.extend(complementary_map.iter()); - assert_eq!(map.len(), 120); - map.values().for_each(|vv| { - if *vv == map.len() { - panic!(); - } - }); -} - -#[test] -fn filter_and_count() { - let list = [None, None, Some(123), Some(91), None]; - let n_some = list.iter().filter(|elem| elem.is_some()).count(); - assert_eq!(n_some, 2); -} - -#[test] -fn position() { - let arr: [Option; 6] = [None, None, Some(0), None, Some(1), None]; - let idx = arr.iter().rev().position(|elem| elem.is_some()).unwrap(); - assert_eq!(4, 6 - 1 - idx); // reverse the index -} - -#[test] -fn float_point_error() { - for _ in 0..10000 { - let split_rr_factor = 2.9123; - let mut split_factor = split_rr_factor.floor(); - split_factor -= 1.0; - black_box(split_factor); - let n = split_factor.to_usize().unwrap(); - assert_eq!(n, 1); - } -} From 6223fa7e6cb2144fb4de1852ac5bf16adec0993d Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:14:49 +0100 Subject: [PATCH 11/17] added a match statement to handle CpuBindError the bind doesn't work on m1 chip apparently --- fastiron/src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fastiron/src/main.rs b/fastiron/src/main.rs index 2aa19c87..b3020baf 100644 --- a/fastiron/src/main.rs +++ b/fastiron/src/main.rs @@ -171,9 +171,13 @@ pub fn bind_threads(thread_id: usize, topo: &Arc>) { unit.cpuset().unwrap() }; - locked_topo - .set_cpubind_for_thread(pthread_id, cpu_set, CpuBindFlags::CPUBIND_THREAD) - .unwrap(); + match locked_topo.set_cpubind_for_thread(pthread_id, cpu_set, CpuBindFlags::CPUBIND_THREAD) { + Ok(_) => {} + Err(e) => { + println!("Could not bind threads to cpu cores:"); + println!("{e:#?}"); + } + } } fn has_ancestor(object: &TopologyObject, ancestor: &TopologyObject) -> bool { From 7cdfb5d394ed8d432e446196ead62c29f18a84fb Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Sat, 3 Feb 2024 11:02:46 +0100 Subject: [PATCH 12/17] small changes in simulation module --- fastiron/src/main.rs | 2 +- fastiron/src/simulation/cycle_tracking.rs | 15 +----------- .../src/simulation/macro_cross_section.rs | 23 +++++++++---------- fastiron/src/simulation/mc_segment_outcome.rs | 17 ++++++-------- fastiron/src/simulation/mct.rs | 3 ++- fastiron/src/simulation/population_control.rs | 17 +++++++------- 6 files changed, 31 insertions(+), 46 deletions(-) diff --git a/fastiron/src/main.rs b/fastiron/src/main.rs index b3020baf..d14ff589 100644 --- a/fastiron/src/main.rs +++ b/fastiron/src/main.rs @@ -174,7 +174,7 @@ pub fn bind_threads(thread_id: usize, topo: &Arc>) { match locked_topo.set_cpubind_for_thread(pthread_id, cpu_set, CpuBindFlags::CPUBIND_THREAD) { Ok(_) => {} Err(e) => { - println!("Could not bind threads to cpu cores:"); + println!("[Error]: Could not bind threads to cpu cores:"); println!("{e:#?}"); } } diff --git a/fastiron/src/simulation/cycle_tracking.rs b/fastiron/src/simulation/cycle_tracking.rs index 94751570..fb5b0f70 100644 --- a/fastiron/src/simulation/cycle_tracking.rs +++ b/fastiron/src/simulation/cycle_tracking.rs @@ -39,9 +39,7 @@ pub fn cycle_tracking_guts( if particle.time_to_census <= zero() { particle.time_to_census += mcdata.params.simulation_params.dt; } - if particle.age < zero() { - particle.age = zero(); - } + particle.age = particle.age.max(zero()); // update energy & task particle.energy_group = mcdata .nuclear_data @@ -111,18 +109,7 @@ fn cycle_tracking_function( // ~~~ off unit case // off-unit transit MCTallyEvent::FacetCrossingCommunication => { - // get destination neighbor unimplemented!() - /* - let neighbor_rank: usize = mcunit.domain - [facet_adjacency.current.domain.unwrap()] - .mesh - .nbr_rank[facet_adjacency.neighbor_index.unwrap()]; - // add to sendqueue - send_queue.lock().unwrap().push(neighbor_rank, particle); - particle.species = Species::Unknown; - false - */ } // bound escape MCTallyEvent::FacetCrossingEscape => { diff --git a/fastiron/src/simulation/macro_cross_section.rs b/fastiron/src/simulation/macro_cross_section.rs index 2846a44e..329875b3 100644 --- a/fastiron/src/simulation/macro_cross_section.rs +++ b/fastiron/src/simulation/macro_cross_section.rs @@ -46,18 +46,17 @@ pub fn weighted_macroscopic_cross_section( cell_nb_density: T, energy_group: usize, ) -> T { - let mut sum: T = zero(); let n_isotopes: usize = mcdata.material_database.mat[mat_gid].iso.len(); - (0..n_isotopes).for_each(|isotope_idx| { - sum += macroscopic_total_cross_section( - mcdata, - mat_gid, - isotope_idx, - cell_nb_density, - energy_group, - ) - }); - - sum + (0..n_isotopes) + .map(|isotope_idx| { + macroscopic_total_cross_section( + mcdata, + mat_gid, + isotope_idx, + cell_nb_density, + energy_group, + ) + }) + .sum() } diff --git a/fastiron/src/simulation/mc_segment_outcome.rs b/fastiron/src/simulation/mc_segment_outcome.rs index 6db9aa41..1ac682ae 100644 --- a/fastiron/src/simulation/mc_segment_outcome.rs +++ b/fastiron/src/simulation/mc_segment_outcome.rs @@ -111,9 +111,8 @@ pub fn outcome( let particle_speed = particle.get_speed(); - let mut force_collision = false; - if particle.num_mean_free_paths < zero() { - force_collision = true; + let force_collision = particle.num_mean_free_paths < zero(); + if force_collision { particle.num_mean_free_paths = small_f; } @@ -140,11 +139,11 @@ pub fn outcome( // prepare particle particle.total_cross_section = macroscopic_total_xsection; - if macroscopic_total_xsection == zero() { - particle.mean_free_path = T::huge_float(); + particle.mean_free_path = if macroscopic_total_xsection == zero() { + T::huge_float() } else { - particle.mean_free_path = one::() / macroscopic_total_xsection; - } + one::() / macroscopic_total_xsection + }; // if zero if particle.num_mean_free_paths == zero() { @@ -215,9 +214,7 @@ pub fn outcome( let segment_path_time = particle.segment_path_length / particle_speed; particle.time_to_census -= segment_path_time; particle.age += segment_path_time; - if particle.time_to_census < zero() { - particle.time_to_census = zero(); - } + particle.time_to_census = particle.time_to_census.max(zero()); segment_outcome } diff --git a/fastiron/src/simulation/mct.rs b/fastiron/src/simulation/mct.rs index 58c29833..ab9e5132 100644 --- a/fastiron/src/simulation/mct.rs +++ b/fastiron/src/simulation/mct.rs @@ -135,9 +135,10 @@ fn mct_nf_3dg( let mut move_factor: T = ::from_f64(0.5).unwrap() * T::small_float(); let tmp: T = FromPrimitive::from_f64(1e-16).unwrap(); - let planes = &mesh.cell_geometry[particle.cell]; let plane_tolerance: T = tmp * (coords.x * coords.x + coords.y * coords.y + coords.z * coords.z); + + let planes = &mesh.cell_geometry[particle.cell]; let mut distance_to_facet: [T; N_FACETS_OUT] = [T::huge_float(); N_FACETS_OUT]; loop { diff --git a/fastiron/src/simulation/population_control.rs b/fastiron/src/simulation/population_control.rs index 89db9185..cec0fb7c 100644 --- a/fastiron/src/simulation/population_control.rs +++ b/fastiron/src/simulation/population_control.rs @@ -29,8 +29,6 @@ pub fn compute_split_factor( num_threads: usize, load_balance: bool, ) -> T { - let mut split_rr_factor: T = one(); - if load_balance { // unit-specific modifications to reach uniform distribution if local_n_particles != 0 { @@ -39,16 +37,19 @@ pub fn compute_split_factor( / FromPrimitive::from_usize(num_threads).unwrap(); tmp.ceil().to_usize().unwrap() }; - split_rr_factor = ::from_usize(local_target_n_particles).unwrap() - / FromPrimitive::from_usize(local_n_particles).unwrap(); + // return + ::from_usize(local_target_n_particles).unwrap() + / FromPrimitive::from_usize(local_n_particles).unwrap() + } else { + // return + one() } } else { // uniform modifications across units without regards to distribution - split_rr_factor = ::from_usize(global_target_n_particles).unwrap() - / FromPrimitive::from_usize(global_n_particles).unwrap(); + // return + ::from_usize(global_target_n_particles).unwrap() + / FromPrimitive::from_usize(global_n_particles).unwrap() } - - split_rr_factor } /// Simulates the sources according to the problem's parameters. From 3ac67e47ee1c7f5f5a9d71df41f1333c43f19625 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Sat, 3 Feb 2024 11:03:59 +0100 Subject: [PATCH 13/17] renamed io_utils mod to input --- fastiron/src/main.rs | 2 +- fastiron/src/parameters.rs | 2 +- fastiron/src/utils/{io_utils.rs => input.rs} | 0 fastiron/src/utils/mod.rs | 2 +- fastiron/tests/io_and_parameters.rs | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename fastiron/src/utils/{io_utils.rs => input.rs} (100%) diff --git a/fastiron/src/main.rs b/fastiron/src/main.rs index d14ff589..72ad02a1 100644 --- a/fastiron/src/main.rs +++ b/fastiron/src/main.rs @@ -16,7 +16,7 @@ use fastiron::parameters::Parameters; use fastiron::particles::particle_container::ParticleContainer; use fastiron::simulation::population_control; use fastiron::utils::coral_benchmark_correctness::coral_benchmark_correctness; -use fastiron::utils::io_utils::Cli; +use fastiron::utils::input::Cli; use fastiron::utils::mc_fast_timer::{self, Section}; use fastiron::utils::mc_processor_info::ExecPolicy; diff --git a/fastiron/src/parameters.rs b/fastiron/src/parameters.rs index 122e3db6..b17e2345 100644 --- a/fastiron/src/parameters.rs +++ b/fastiron/src/parameters.rs @@ -8,7 +8,7 @@ use rustc_hash::FxHashMap; use crate::{ constants::CustomFloat, - utils::io_utils::{parse_input_file, Cli, InputError}, + utils::input::{parse_input_file, Cli, InputError}, }; /// Alias for a `` [`FxHashMap`]. See here for detailed diff --git a/fastiron/src/utils/io_utils.rs b/fastiron/src/utils/input.rs similarity index 100% rename from fastiron/src/utils/io_utils.rs rename to fastiron/src/utils/input.rs diff --git a/fastiron/src/utils/mod.rs b/fastiron/src/utils/mod.rs index 43ac7a65..b5841c26 100644 --- a/fastiron/src/utils/mod.rs +++ b/fastiron/src/utils/mod.rs @@ -3,7 +3,7 @@ pub mod comm_object; pub mod coral_benchmark_correctness; pub mod decomposition_object; -pub mod io_utils; +pub mod input; pub mod mc_fast_timer; pub mod mc_processor_info; pub mod mc_rng_state; diff --git a/fastiron/tests/io_and_parameters.rs b/fastiron/tests/io_and_parameters.rs index 4488065f..8c2290ef 100644 --- a/fastiron/tests/io_and_parameters.rs +++ b/fastiron/tests/io_and_parameters.rs @@ -1,7 +1,7 @@ use fastiron::{ parameters::{GeometryParameters, ParameterError, Parameters, Shape, SimulationParameters}, utils::{ - io_utils::{parse_input_file, Cli, InputError}, + input::{parse_input_file, Cli, InputError}, mc_processor_info::{ExecPolicy, MCProcessorInfo}, }, }; From 6c915218d240418d28be81d3107f7e0296096941 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Sat, 3 Feb 2024 11:11:01 +0100 Subject: [PATCH 14/17] version bump + dependencies update --- Cargo.lock | 498 ++++++++++++++++++++------------------ fastiron-stats/Cargo.toml | 8 +- fastiron/Cargo.toml | 22 +- 3 files changed, 272 insertions(+), 256 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2648f2d8..c164c74c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + [[package]] name = "anes" version = "0.1.6" @@ -10,48 +19,47 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys", @@ -75,17 +83,23 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cast" @@ -95,9 +109,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -107,9 +124,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -118,15 +135,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -134,34 +151,31 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.5" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2686c4115cb0810d9a984776e197823d08ec94f176549a89a9efded477c456dc" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.5" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e53afce1efce6ed1f633cf0e57612fe51db54a1ee4fd8f8503d078fe02d69ae" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", - "bitflags", "clap_lex", - "once_cell", "strsim", ] [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -171,9 +185,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "colorchoice" @@ -217,54 +231,42 @@ dependencies = [ "itertools", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "csv" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ "csv-core", "itoa", @@ -274,18 +276,24 @@ dependencies = [ [[package]] name = "csv-core" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" dependencies = [ "memchr", ] [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -300,11 +308,10 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.1" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] @@ -321,15 +328,15 @@ dependencies = [ [[package]] name = "fastiron" -version = "1.3.0" +version = "1.3.2" dependencies = [ "atomic", "clap", "criterion", "hwloc2", "libc", - "num 0.4.0", - "rand", + "num", + "rand 0.8.5", "rayon", "rustc-hash", "serde_yaml", @@ -338,18 +345,24 @@ dependencies = [ [[package]] name = "fastiron-stats" -version = "1.1.0" +version = "1.1.1" dependencies = [ "clap", "csv", "gnuplot", ] +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -367,15 +380,19 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -385,18 +402,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hwloc2" @@ -404,44 +412,32 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f2a4b6f52a58293f5a69375e8bedfc53b15e439f751d9d20a62689632fe348e" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno 0.2.8", "kernel32-sys", "libc", - "num 0.1.42", + "num", "pkg-config", "winapi 0.2.8", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys", -] - [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", + "hermit-abi", "rustix", "windows-sys", ] @@ -457,15 +453,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -482,53 +478,33 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.146" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "num" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" -dependencies = [ - "num-integer", - "num-iter", - "num-traits", -] - -[[package]] -name = "num" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" dependencies = [ "num-bigint", "num-complex", @@ -540,22 +516,24 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" dependencies = [ - "autocfg", "num-integer", "num-traits", + "rand 0.4.6", + "rustc-serialize", ] [[package]] name = "num-complex" -version = "0.4.3" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" dependencies = [ "num-traits", + "rustc-serialize", ] [[package]] @@ -581,40 +559,30 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", + "rustc-serialize", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi 0.2.6", - "libc", -] - [[package]] name = "once_cell" -version = "1.17.2" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -624,9 +592,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "plotters" @@ -664,22 +632,35 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi 0.3.9", +] + [[package]] name = "rand" version = "0.8.5" @@ -688,7 +669,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -698,9 +679,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", ] +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + [[package]] name = "rand_core" version = "0.6.4" @@ -712,9 +708,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -722,30 +718,51 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", ] [[package]] name = "regex" -version = "1.8.3" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc-hash" @@ -753,15 +770,20 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-serialize" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe834bc780604f4674073badbad26d7219cadfb4a2275802db12cbae17498401" + [[package]] name = "rustix" -version = "0.37.19" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags", - "errno 0.3.1", - "io-lifetimes", + "bitflags 2.4.2", + "errno 0.3.8", "libc", "linux-raw-sys", "windows-sys", @@ -769,9 +791,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -782,26 +804,20 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - [[package]] name = "serde" -version = "1.0.163" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -810,9 +826,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -821,9 +837,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.21" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ "indexmap", "itoa", @@ -840,9 +856,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.18" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -867,15 +883,15 @@ checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unsafe-libyaml" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "utf8parse" @@ -885,9 +901,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -901,9 +917,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -911,9 +927,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -926,9 +942,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -936,9 +952,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -949,15 +965,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -993,9 +1009,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi 0.3.9", ] @@ -1008,18 +1024,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1032,42 +1048,42 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/fastiron-stats/Cargo.toml b/fastiron-stats/Cargo.toml index 499601c3..2230cfa0 100644 --- a/fastiron-stats/Cargo.toml +++ b/fastiron-stats/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "fastiron-stats" -version = "1.1.0" +version = "1.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.3.5", features = ["cargo", "derive"] } -csv = "1.2.2" -gnuplot = "0.0.38" +clap = { version = "*", features = ["cargo", "derive"] } +csv = "*" +gnuplot = "*" diff --git a/fastiron/Cargo.toml b/fastiron/Cargo.toml index 2929a36c..8c9513f7 100644 --- a/fastiron/Cargo.toml +++ b/fastiron/Cargo.toml @@ -1,24 +1,24 @@ [package] name = "fastiron" -version = "1.3.0" +version = "1.3.2" edition = "2021" # DEPENDENCIES [dependencies] -clap = { version = "4.3.5", features = ["cargo", "derive"] } -serde_yaml = { version = "0.9.21", features = [] } -num = { version = "0.4.0" } -rand = { version = "0.8.5", features = ["small_rng"] } -tinyvec = { version = "1.6.0" } -rayon = { version = "1.7.0" } -atomic = { version = "0.5.3" } +clap = { version = "*", features = ["cargo", "derive"] } +serde_yaml = { version = "*", features = [] } +num = { version = "*" } +rand = { version = "*", features = ["small_rng"] } +tinyvec = { version = "*" } +rayon = { version = "*" } +atomic = { version = "0.5.3" } # further upgrade == breaking change hwloc2 = { version = "2.2.0" } -libc = { version = "0.2.146" } -rustc-hash = { version = "1.1.0" } +libc = { version = "*" } +rustc-hash = { version = "*" } [dev-dependencies] -criterion = { version = "0.5.1", features = ["html_reports"] } +criterion = { version = "*", features = ["html_reports"] } # FEATURES [features] From 4924b3c42760b8d08403b5d0365fe4c9643c1276 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Sat, 3 Feb 2024 11:13:07 +0100 Subject: [PATCH 15/17] fixed doc warning --- fastiron-stats/src/structures/raw.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastiron-stats/src/structures/raw.rs b/fastiron-stats/src/structures/raw.rs index 611fd1bb..1d18ef5f 100644 --- a/fastiron-stats/src/structures/raw.rs +++ b/fastiron-stats/src/structures/raw.rs @@ -119,7 +119,7 @@ impl TalliedVariable { } } -/// Returns the covariance of two given [FiniteDiscreteRV]. +/// Returns the covariance of two given [TalliedVariable]. pub fn covariance(x: &TalliedVariable, y: &TalliedVariable) -> f64 { assert_eq!(x.n_val(), y.n_val()); let iter = zip(x.values.iter(), y.values.iter()); @@ -128,11 +128,11 @@ pub fn covariance(x: &TalliedVariable, y: &TalliedVariable) -> f64 { cov } -/// Returns the correlation coefficient of two given [FiniteDiscreteRV]. +/// Returns the correlation coefficient of two given [TalliedVariable]. /// /// The function checks if `x` and `y` have non-zero variance. If this is the case, /// 0 is returned. It means variables are independent. While this may be technically -/// false, it allows for generic computations +/// false, it allows for generic computations. pub fn correlation(x: &TalliedVariable, y: &TalliedVariable) -> f64 { if (x.variance == 0.0) | (y.variance == 0.0) { // From a9f6f0d96f8f0c4ec502734baf0e9a6012e427a9 Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Sat, 3 Feb 2024 11:16:05 +0100 Subject: [PATCH 16/17] fixed cargo warning --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 516b9d9b..09139b79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] +resolver= "2" members = ["fastiron", "fastiron-stats"] [profile.release] From 9c6eadd7815ccef19a524e61ed6a0b1fdac074fb Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Sat, 3 Feb 2024 11:21:31 +0100 Subject: [PATCH 17/17] fixed doc example --- fastiron/src/data/mc_vector.rs | 2 +- fastiron/src/parameters.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fastiron/src/data/mc_vector.rs b/fastiron/src/data/mc_vector.rs index 855d5959..1bef3c67 100644 --- a/fastiron/src/data/mc_vector.rs +++ b/fastiron/src/data/mc_vector.rs @@ -20,7 +20,7 @@ use crate::constants::CustomFloat; /// assert_eq!(v + w, MCVector {x: 3.0, y: 3.0, z: 3.0}); /// // w/2 == v /// w /= 2.0; -/// assert!(w.is_almost_equal(&v)); +/// assert_eq!(v, w); /// /// ``` #[derive(Debug, Clone, Copy, PartialOrd, PartialEq, Default)] diff --git a/fastiron/src/parameters.rs b/fastiron/src/parameters.rs index b17e2345..32bce22b 100644 --- a/fastiron/src/parameters.rs +++ b/fastiron/src/parameters.rs @@ -368,7 +368,7 @@ impl SimulationParameters { /// /// ```rust /// use clap::Parser; - /// use fastiron::utils::io_utils::Cli; + /// use fastiron::utils::input::Cli; /// use fastiron::parameters::SimulationParameters; /// ///