Skip to content

Commit

Permalink
make cmd_merge use multiple threads again
Browse files Browse the repository at this point in the history
implements the fix suggested here: google-research#19
  • Loading branch information
TristanThrush committed Sep 30, 2022
1 parent ad86c7f commit 3081a12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Expand Up @@ -1019,7 +1019,7 @@ fn cmd_merge(data_files: &Vec<String>, output_file: &String, num_threads: i64)

// Make sure we have enough space to take strided offsets for multiple threads
// This should be an over-approximation, and starts allowing new threads at 1k of data
let num_threads = std::cmp::min(num_threads, std::cmp::max((texts.len() as i64 - 1024)/10, 1));
let num_threads = std::cmp::min(num_threads, std::cmp::max((texts_len.iter().sum::<usize>() as i64 - 1024)/10, 1));
println!("AA {}", num_threads);

// Start a bunch of jobs that each work on non-overlapping regions of the final resulting suffix array
Expand Down

0 comments on commit 3081a12

Please sign in to comment.