torognes / vsearch

Versatile open-source tool for microbiome analysis
Other
656 stars 122 forks source link

Check for SSSE3 should be build time, not run time. #497

Closed heshpdx closed 2 years ago

heshpdx commented 2 years ago

In cpu.cc, we use preprocessor directives to discover SSSE3 vs SSE2, but in searchcore.cc we use a runtime variable based on cpuid. This changeset makes it match by using preprocessor in both places. This makes the code more resilient in different environments, or if someone forgot to pass -DSSSE3 on the build line.

Also, added one switch which was missing from help printout. There are others that are missing, like --sample but I don't know what that does.

torognes commented 2 years ago

Sorry, but the check should intentionally be at run time in searchcore.cc. The cpu.cc source file is actually compiled twice, with and without SSSE3, and both are included, so the resulting binary for x86_64 is able to run both with and without SSSE3.

heshpdx commented 2 years ago

Aha, thanks for the clarification, I understand now. We can close this. Incidentally, I haven't been able to exercise the increment_counters_from_bitmap function at all. What command lines would actuate the bitmap functionality? Or is it based on a specific fasta input file? Thanks.

torognes commented 2 years ago

The increment_counters_from_bitmap function is only used in rare cases when a dataset includes some k-mers that are present in a very large fraction of the sequences in the database. This can happen if the dataset includes many very similar sequences. It is then used during the k-mer search in usearch_global, orient, clustering, chimera detection etc.