[med-svn] [Git][med-team/diamond-aligner][upstream] New upstream version 2.0.14
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sun Jan 16 15:33:17 GMT 2022
Andreas Tille pushed to branch upstream at Debian Med / diamond-aligner
Commits:
81c84b01 by Andreas Tille at 2022-01-16T16:20:15+01:00
New upstream version 2.0.14
- - - - -
17 changed files:
- + .travis.yml
- CMakeLists.txt
- src/ChangeLog
- src/basic/basic.cpp
- src/basic/const.h
- src/dp/score_vector_int16.h
- src/dp/score_vector_int8.h
- src/dp/swipe/banded_3frame_swipe.cpp
- src/dp/swipe/banded_swipe.h
- src/dp/swipe/full_swipe.h
- src/dp/swipe/swipe.h
- src/output/blast_tab_format.cpp
- src/test/test_cases.cpp
- src/tools/benchmark.cpp
- src/tools/benchmark_swipe.cpp
- src/util/simd.h
- src/util/system/system.cpp
Changes:
=====================================
.travis.yml
=====================================
@@ -0,0 +1,36 @@
+os:
+ - linux
+ - osx
+
+dist:
+# - xenial
+ - trusty
+
+language: c++
+
+#addons:
+# apt:
+# packages:
+# - gdb
+# - libclang-common-6.0-dev
+
+arch:
+ - amd64
+ - arm64
+ - ppc64le
+ - s390x
+
+compiler:
+ - g++
+# - clang
+
+install: skip
+
+script:
+ - mkdir build
+ - cd build
+ - cmake -DCMAKE_BUILD_TYPE=Release ..
+ - make
+# - gdb --ex=r -return-child-result -batch -ex bt --args ./diamond test
+# - lldb --batch --one-line r --one-line-on-crash bt -- ./diamond test
+ - ./diamond test
\ No newline at end of file
=====================================
CMakeLists.txt
=====================================
@@ -116,13 +116,16 @@ set(DISPATCH_OBJECTS
"src/dp/swipe/banded_3frame_swipe.cpp"
"src/search/stage2.cpp"
"src/tools/benchmark.cpp"
-"src/tools/benchmark_swipe.cpp"
"src/dp/swipe/swipe_wrapper.cpp"
"src/util/tantan.cpp"
"src/dp/scan_diags.cpp"
"src/dp/ungapped_simd.cpp"
)
+if(EXTRA)
+ LIST(APPEND DISPATCH_OBJECTS "src/tools/benchmark_swipe.cpp")
+endif()
+
add_library(arch_generic OBJECT ${DISPATCH_OBJECTS})
target_compile_options(arch_generic PUBLIC -DDISPATCH_ARCH=ARCH_GENERIC -DARCH_ID=0 -DEigen=Eigen_GENERIC)
target_include_directories(arch_generic PRIVATE "${CMAKE_SOURCE_DIR}/src/lib")
=====================================
src/ChangeLog
=====================================
@@ -1,3 +1,10 @@
+[2.0.14]
+- Fixed a compiler error on Linux systems that do not define `_SC_LEVEL3_CACHE_SIZE`.
+- Fixed an error when using `--unal 1` with the `cigar` output field.
+- Fixed an `illegal instruction` error on systems that did not support AVX2.
+- Fixed a bug (present since v2.0.12) that could cause an error or suboptimal
+ alignments when HSP filter settings were used.
+
[2.0.13]
- Fixed a bug that caused invalid bit scores in frameshift alignment mode.
=====================================
src/basic/basic.cpp
=====================================
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../util/util.h"
#include "../stats/standard_matrix.h"
-const char* Const::version_string = "2.0.13";
+const char* Const::version_string = "2.0.14";
const char* Const::program_name = "diamond";
Align_mode::Align_mode(unsigned mode) :
=====================================
src/basic/const.h
=====================================
@@ -25,7 +25,7 @@ struct Const
{
enum {
- build_version = 151,
+ build_version = 152,
#ifdef SINGLE_THREADED
seedp_bits = 0,
#else
=====================================
src/dp/score_vector_int16.h
=====================================
@@ -206,30 +206,9 @@ struct ScoreVector<int16_t, DELTA>
data_(_mm_loadu_si128((const __m128i*)x))
{}
- ScoreVector(unsigned a, uint64_t seq)
- {
- const uint16_t* row((uint16_t*)&score_matrix.matrix16()[a << 5]);
- uint64_t b = uint64_t(row[seq & 0xff]);
- seq >>= 8;
- b |= uint64_t(row[seq & 0xff]) << 16;
- seq >>= 8;
- b |= uint64_t(row[seq & 0xff]) << 16 * 2;
- seq >>= 8;
- b |= uint64_t(row[seq & 0xff]) << 16 * 3;
- seq >>= 8;
- uint64_t c = uint64_t(row[seq & 0xff]);
- seq >>= 8;
- c |= uint64_t(row[seq & 0xff]) << 16;
- seq >>= 8;
- c |= uint64_t(row[seq & 0xff]) << 16 * 2;
- seq >>= 8;
- c |= uint64_t(row[seq & 0xff]) << 16 * 3;
- data_ = _mm_set_epi64x(c, b);
- }
-
+#ifdef __SSSE3__
ScoreVector(unsigned a, Register seq)
{
-#ifdef __SSSE3__
const __m128i *row = reinterpret_cast<const __m128i*>(&score_matrix.matrix8u()[a << 5]);
__m128i high_mask = _mm_slli_epi16(_mm_and_si128(seq, ::SIMD::_mm_set1_epi8('\x10')), 3);
@@ -242,8 +221,8 @@ struct ScoreVector<int16_t, DELTA>
__m128i s2 = _mm_shuffle_epi8(r2, seq_high);
data_ = _mm_and_si128(_mm_or_si128(s1, s2), ::SIMD::_mm_set1_epi16(255));
data_ = _mm_subs_epi16(data_, ::SIMD::_mm_set1_epi16(score_matrix.bias()));
-#endif
}
+#endif
ScoreVector operator+(const ScoreVector&rhs) const
{
=====================================
src/dp/score_vector_int8.h
=====================================
@@ -238,6 +238,7 @@ struct ScoreVector<int8_t, DELTA>
data_(_mm_loadu_si128(reinterpret_cast<const __m128i*>(s)))
{ }
+#ifdef __SSSE3__
ScoreVector(unsigned a, __m128i seq)
{
const __m128i* row = reinterpret_cast<const __m128i*>(&score_matrix.matrix8()[a << 5]);
@@ -252,6 +253,7 @@ struct ScoreVector<int8_t, DELTA>
__m128i s2 = _mm_shuffle_epi8(r2, seq_high);
data_ = _mm_or_si128(s1, s2);
}
+#endif
ScoreVector operator+(const ScoreVector&rhs) const
{
=====================================
src/dp/swipe/banded_3frame_swipe.cpp
=====================================
@@ -425,6 +425,7 @@ list<Hsp> banded_3frame_swipe(
frameshift_penalty(score_matrix.frame_shift());
SwipeProfile<_sv> profile;
+ std::array<const int8_t*, 32> target_scores;
Score best[ScoreTraits<_sv>::CHANNELS];
int max_col[ScoreTraits<_sv>::CHANNELS];
for (int i = 0; i < ScoreTraits<_sv>::CHANNELS; ++i) {
@@ -443,7 +444,11 @@ list<Hsp> banded_3frame_swipe(
_sv vgap0, vgap1, vgap2, hgap, col_best;
vgap0 = vgap1 = vgap2 = col_best = ScoreTraits<_sv>::zero();
+#ifdef __SSSE3__
profile.set(targets.get());
+#else
+ profile.set(targets.get(target_scores.data()));
+#endif
for (int i = i0_; i <= i1_; ++i) {
hgap = it.hgap();
_sv next = cell_update<_sv>(it.sm3, it.sm4, it.sm2, profile.get(q[0][i]), extend_penalty, open_penalty, frameshift_penalty, hgap, vgap0, col_best);
=====================================
src/dp/swipe/banded_swipe.h
=====================================
@@ -97,14 +97,16 @@ Hsp traceback(_cbs bias_correction, const Matrix<Cell> &dp, const DpTarget &targ
out.bit_score = score_matrix.bitscore(out.score);
out.frame = p.frame.index();
out.matrix = target.matrix;
- out.d_begin = target.d_begin;
- out.d_end = target.d_end;
const int j0 = i1 - (target.d_end - 1), i1_ = i0 + max_col + max_band_i + 1, j1_ = j0 + max_col + 1;
if (target.carry_over.i1 == 0) {
+ out.d_begin = target.d_begin;
+ out.d_end = target.d_end;
out.query_range.end_ = i1_;
out.subject_range.end_ = j1_;
}
else {
+ out.d_begin = -target.d_end + (int)p.query.length() - (int)target.seq.length() + 1;
+ out.d_end = -target.d_begin + (int)p.query.length() - (int)target.seq.length() + 1;
out.query_range.end_ = target.carry_over.i1;
out.subject_range.end_ = target.carry_over.j1;
out.identities = target.carry_over.ident;
@@ -252,7 +254,11 @@ list<Hsp> swipe(const vector<DpTarget>::const_iterator subject_begin, const vect
profile.set(targets.get(target_scores.data()));
}
else {
+#ifdef __SSSE3__
profile.set(target_seqv);
+#else
+ profile.set(targets.get(target_scores.data()));
+#endif
}
#ifdef DP_STAT
const uint64_t live = targets.live();
=====================================
src/dp/swipe/full_swipe.h
=====================================
@@ -162,7 +162,11 @@ list<Hsp> swipe(const It target_begin, const It target_end, std::atomic_size_t*
profile.set(targets.get(target_scores.data()));
}
else {
+#ifdef __SSSE3__
profile.set(target_seq_vector);
+#else
+ profile.set(targets.get(target_scores.data()));
+#endif
}
#ifdef DP_STAT
=====================================
src/dp/swipe/swipe.h
=====================================
@@ -92,12 +92,14 @@ template<typename Sv>
struct SwipeProfile
{
+#ifdef __SSSE3__
inline void set(typename ScoreTraits<Sv>::Vector seq)
{
assert(sizeof(data_) / sizeof(Sv) >= value_traits.alphabet_size);
for (unsigned j = 0; j < AMINO_ACID_COUNT; ++j)
data_[j] = Sv(j, seq);
}
+#endif
inline const Sv& get(Letter i) const
{
@@ -166,7 +168,7 @@ struct SwipeProfile<int32_t>
for (int i = 0; i < 32; ++i)
row[i] = target_scores[0][i];
}
- void set(const int32_t * *target_scores) {
+ void set(const int32_t** target_scores) {
for (int i = 0; i < 32; ++i)
row[i] = target_scores[0][i];
}
=====================================
src/output/blast_tab_format.cpp
=====================================
@@ -489,6 +489,7 @@ void Blast_tab_format::print_query_intro(size_t query_num, const char *query_nam
case 55:
case 56:
case 57:
+ case 58:
case 59:
case 60:
case 63:
=====================================
src/test/test_cases.cpp
=====================================
@@ -66,7 +66,7 @@ const vector<uint64_t> ref_hashes = {
0xe787dcb23cc5b120,
0x5aa4baf48a888be9,
0xa2519e06e3bfa2fd,
-0x1edd906017a3ddb2,
+0xc393e16a2f782562,
0x67b3a14cdd541dc3,
};
=====================================
src/tools/benchmark.cpp
=====================================
@@ -55,7 +55,7 @@ using namespace DISPATCH_ARCH;
namespace Benchmark { namespace DISPATCH_ARCH {
-#ifdef __SSE4_1__
+#if defined(__SSE4_1__) && defined(EXTRA)
void swipe_cell_update();
#endif
@@ -327,7 +327,7 @@ void matrix_adjust(const Sequence& s1, const Sequence& s2) {
void benchmark() {
if (config.type == "swipe") {
-#ifdef __SSE4_1__
+#if defined(__SSE4_1__) && defined(EXTRA)
swipe_cell_update();
#endif
return;
=====================================
src/tools/benchmark_swipe.cpp
=====================================
@@ -20,12 +20,10 @@ static const size_t N = 256;
using Sv = ScoreVector<int8_t, SCHAR_MIN>;
using Cell = ForwardCell<Sv>;
//using Cell = Sv;
-static Cell diagonal_cell[N], horizontal_gap[N];
static char query[N];
-static Sv profile[32];
static const size_t C = ScoreTraits<Sv>::CHANNELS;
-static void update_row() {
+static void update_row(Cell* diagonal_cell, Cell* horizontal_gap, Sv* profile) {
//auto id_mask = DummyIdMask<Sv>(0, Sv());
auto id_mask = VectorIdMask<Sv>(0, Sv());
//auto row_counter = DummyRowCounter(0);
@@ -41,6 +39,8 @@ static void update_row() {
void swipe_cell_update() {
static const size_t n = 1000000llu;
+ Cell diagonal_cell[N], horizontal_gap[N];
+ Sv profile[32];
for (size_t i = 0; i < N; ++i) {
query[i] = rand() % 32;
}
@@ -53,7 +53,7 @@ void swipe_cell_update() {
high_resolution_clock::time_point t1 = high_resolution_clock::now();
for (size_t i = 0; i < n; ++i) {
- update_row();
+ update_row(diagonal_cell, horizontal_gap, profile);
}
volatile auto x = diagonal_cell[0].data_;
volatile auto y = diagonal_cell[0].ident;
=====================================
src/util/simd.h
=====================================
@@ -102,7 +102,9 @@ static inline __m256i _mm256_set1_epi16(short v) {
#endif
}
+#if defined(__GNUC__) && __GNUC__ < 8
#define _mm256_set_m128i(v0, v1) _mm256_insertf128_si256(_mm256_castsi128_si256(v1), (v0), 1)
+#endif
inline void print_8(__m256i x, std::ostream& s) {
alignas(32) int8_t v[32];
=====================================
src/util/system/system.cpp
=====================================
@@ -192,7 +192,7 @@ void unmap_file(char* ptr, size_t size, int fd) {
}
size_t l3_cache_size() {
-#if defined(_MSC_VER) || defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(_MSC_VER) || defined(__APPLE__) || defined(__FreeBSD__) || (! defined(_SC_LEVEL3_CACHE_SIZE))
return 0;
#else
const auto s = sysconf(_SC_LEVEL3_CACHE_SIZE);
View it on GitLab: https://salsa.debian.org/med-team/diamond-aligner/-/commit/81c84b01fab3558d2e53b11e1fddbccd2701c12d
--
View it on GitLab: https://salsa.debian.org/med-team/diamond-aligner/-/commit/81c84b01fab3558d2e53b11e1fddbccd2701c12d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220116/cb5dcf20/attachment-0001.htm>
More information about the debian-med-commit
mailing list