Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Nov 10, 2024
1 parent 6708835 commit 18e11c1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sourmash_plugin_branchwater"
version = "0.10.0-dev"
version = "0.9.10-dev"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 0 additions & 3 deletions src/fastmultigather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ pub fn fastmultigather(

let query_mh = query_mh.downsample_scaled(common_scaled).expect("fiz");

// eprintln!("ABC query scaled: {}", query_mh.scaled()); // @CTB

// CTB refactor
let query_scaled = query_mh.scaled();
let query_ksize = query_mh.ksize().try_into().unwrap();
Expand All @@ -126,7 +124,6 @@ pub fn fastmultigather(
let matchlist: BinaryHeap<PrefetchResult> = against
.iter()
.filter_map(|against| {
// eprintln!("against scaled: {} / query scaled: {}", against.minhash.scaled(), query_mh.scaled()); @CTB
let mut mm: Option<PrefetchResult> = None;
if let Ok(overlap) = against.minhash.count_common(&query_mh, false) {
if overlap >= threshold_hashes {
Expand Down
18 changes: 8 additions & 10 deletions src/fastmultigather_rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ pub fn fastmultigather_rocksdb(
let db = RevIndex::open(index, true, None)?;
println!("Loaded DB");

let query_set_scaled = selection.scaled().expect("fiz");

let query_collection = load_collection(
&queries_file,
&selection,
Expand All @@ -51,13 +49,17 @@ pub fn fastmultigather_rocksdb(
scaled
}
};
let query_set_scaled = scaled; // redundant, but is nicer name

let mut against_selection = selection;
against_selection.set_scaled(scaled);

// update query collection scaled value, too?
let mut query_collection = query_collection;
if scaled != query_set_scaled {
query_collection = query_collection.select(&against_selection).expect("fiz");
query_collection = query_collection
.select(&against_selection)
.expect("cannot properly downsample query collection");
}

// set up a multi-producer, single-consumer channel.
Expand All @@ -81,7 +83,6 @@ pub fn fastmultigather_rocksdb(
let send = query_collection
.par_iter()
.filter_map(|(coll, _idx, record)| {
// eprintln!("XXX record scaled: {}", record.scaled()); @CTB
let threshold = threshold_bp / against_selection.scaled().expect("scaled is not set!?");
let ksize = against_selection.ksize().expect("ksize not set!?");

Expand All @@ -94,12 +95,9 @@ pub fn fastmultigather_rocksdb(

let mut results = vec![];
if let Ok(query_mh) = <SigStore as TryInto<KmerMinHash>>::try_into(query_sig) {
// eprintln!("selection: {}; query_mh scaled: {}", // @CTB
// query_set_scaled, query_mh.scaled());
let query_mh = query_mh.downsample_scaled(query_set_scaled).expect("bar");
//eprintln!("XYZ selection: {}; query_mh scaled: {}",
// query_set_scaled, query_mh.scaled()); @CTB

let query_mh = query_mh
.downsample_scaled(query_set_scaled)
.expect("cannot downsample!?");
let _ = processed_sigs.fetch_add(1, atomic::Ordering::SeqCst);
// Gather!
let (counter, query_colors, hash_to_color) =
Expand Down

0 comments on commit 18e11c1

Please sign in to comment.