From 87f7a57d727f8c4ed61f48cd6434d1612e905b76 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 15 Nov 2022 11:46:29 -0500 Subject: [PATCH] Update random seed usage in rust code In #9132 we updated the random seed parameters in the rust code for sabre swap to make the seed optional and default to initializing from entropy if it's not specified. This commit updates the usage to account for this change on main. --- src/sabre_layout.rs | 4 ++-- src/sabre_swap/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sabre_layout.rs b/src/sabre_layout.rs index 0a0838482bf1..7065ef388b39 100644 --- a/src/sabre_layout.rs +++ b/src/sabre_layout.rs @@ -140,7 +140,7 @@ fn layout_trial( neighbor_table, distance_matrix, heuristic, - seed, + Some(seed), &mut pass_final_layout, num_swap_trials, Some(run_swap_in_parallel), @@ -158,7 +158,7 @@ fn layout_trial( neighbor_table, distance_matrix, heuristic, - seed, + Some(seed), &mut final_layout, num_swap_trials, Some(run_swap_in_parallel), diff --git a/src/sabre_swap/mod.rs b/src/sabre_swap/mod.rs index 8e4d46485034..1b49103ab100 100644 --- a/src/sabre_swap/mod.rs +++ b/src/sabre_swap/mod.rs @@ -178,7 +178,7 @@ pub fn build_swap_map_inner( neighbor_table: &NeighborTable, dist: &ArrayView2, heuristic: &Heuristic, - seed: u64, + seed: Option, layout: &mut NLayout, num_trials: usize, run_in_parallel: Option,