diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..fd5d17f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,84 @@ +name: Deploy + +on: + release: + types: + - created + +jobs: + + + ######################################################################################## + checkout: + name: Checkout + strategy: + matrix: + machine: [x64_linux, x64_mac, arm64_linux, arm64_mac] + runs-on: [self-hosted, kmer-db, '${{ matrix.machine }}'] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + +######################################################################################## + make: + name: Make + needs: checkout + strategy: + fail-fast: false + matrix: + machine: [x64_linux] + platform: [avx2] + compiler: [g++-13] + static: [true] + include: + - {machine: arm64_linux, platform: arm8, compiler: g++-12, static: true} + - {machine: x64_mac, platform: avx2, compiler: g++-13, static: false} + - {machine: arm64_mac, platform: m1, compiler: g++-13, static: false} + + runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] + + steps: + - name: make + run: | + make clean + make -j32 CXX=${{matrix.compiler}} STATIC_LINK=${{ matrix.static }} PLATFORM=${{ matrix.platform }} + - name: tar artifacts + run: tar -cvzf famsa.tar.gz famsa LICENSE + + +######################################################################################## + help: + name: Print usage + needs: make + strategy: + fail-fast: false + matrix: + machine: [x64_linux, x64_mac, arm64_linux, arm64_mac] + runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] + + steps: + - name: help + run: ./famsa + +######################################################################################## + upload: + name: Upload + needs: help + strategy: + fail-fast: false + matrix: + machine: [x64_linux, x64_mac, arm64_linux, arm64_mac] + runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] + + steps: + - name: deploy + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./famsa.tar.gz + asset_name: famsa-${{ github.event.release.tag_name }}-${{matrix.machine}}.tar.gz + asset_content_type: application/gzip diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index f2d7346..05ad55b 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -15,7 +15,7 @@ jobs: name: checkout strategy: matrix: - machine: [xeon, tripper, raspberry, mac-m1, mac-i7] + machine: [xeon, x64_linux, x64_mac, arm64_linux, arm64_mac] runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] steps: @@ -37,36 +37,15 @@ jobs: strategy: fail-fast: false matrix: - # multiple X64 configurations - machine: [xeon, tripper] - compiler: [g++-9, g++-10, g++-11] + machine: [x64_linux] + compiler: [g++-9, g++-10, g++-11, g++-12, g++] platform: [avx2] - # additional ARM configurations include: - - machine: raspberry - compiler: g++ - platform: arm8 - - - machine: mac-m1 - compiler: g++ - platform: m1 - - machine: mac-i7 - compiler: g++ - platform: avx2 - -# - machine: old -# compiler: g++-5 -# platform: avx2 -# - machine: old -# compiler: g++-6 -# platform: avx2 -# - machine: old -# compiler: g++-7 -# platform: avx2 -# - machine: old -# compiler: g++-8 -# platform: avx2 - + - {machine: xeon, platform: avx2, compiler: g++} + - {machine: arm64_linux, platform: arm8, compiler: g++} + - {machine: x64_mac, platform: avx2, compiler: g++} + - {machine: arm64_mac, platform: m1, compiler: g++} + runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] steps: @@ -85,17 +64,13 @@ jobs: strategy: fail-fast: false matrix: - machine: [xeon, tripper] - compiler: [g++-9, g++-10, g++-11] - # additional ARM configurations + machine: [xeon, x64_linux, arm64_linux, x64_mac, arm64_mac] + compiler: [g++] include: - - machine: raspberry - compiler: g++ - - - machine: mac-m1 - compiler: g++ - - machine: mac-i7 - compiler: g++ + - {machine: x64_linux, compiler: g++-9} + - {machine: x64_linux, compiler: g++-10} + - {machine: x64_linux, compiler: g++-11} + - {machine: x64_linux, compiler: g++-12} runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] @@ -133,54 +108,19 @@ jobs: strategy: fail-fast: false matrix: - machine: [xeon, tripper] - compiler: [g++-9, g++-10, g++-11] + machine: [xeon, x64_linux, arm64_linux, x64_mac, arm64_mac] + compiler: [g++] tree: [sl, upgma, slink] - # additional ARM configurations include: - - machine: raspberry - compiler: g++ - tree: sl - - machine: raspberry - compiler: g++ - tree: upgma - - machine: raspberry - compiler: g++ - tree: slink - - - machine: mac-m1 - compiler: g++ - tree: sl - - machine: mac-m1 - compiler: g++ - tree: upgma - - machine: mac-m1 - compiler: g++ - tree: slink - - - machine: mac-i7 - compiler: g++ - tree: sl - - machine: mac-i7 - compiler: g++ - tree: upgma - - machine: mac-i7 - compiler: g++ - tree: slink - -# - machine: old -# compiler: g++-5 -# tree: sl -# - machine: old -# compiler: g++-6 -# tree: sl -# - machine: old -# compiler: g++-7 -# tree: sl -# - machine: old -# compiler: g++-8 -# tree: sl - + - {machine: x64_linux, compiler: g++-9, tree: sl} + - {machine: x64_linux, compiler: g++-9, tree: upgma} + - {machine: x64_linux, compiler: g++-10, tree: sl} + - {machine: x64_linux, compiler: g++-10, tree: upgma} + - {machine: x64_linux, compiler: g++-11, tree: sl} + - {machine: x64_linux, compiler: g++-11, tree: upgma} + - {machine: x64_linux, compiler: g++-12, tree: sl} + - {machine: x64_linux, compiler: g++-12, tree: upgma} + runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] env: @@ -218,22 +158,15 @@ jobs: strategy: fail-fast: false matrix: - machine: [xeon, tripper] - compiler: [g++-9, g++-11] + machine: [xeon, x64_linux, arm64_linux, x64_mac, arm64_mac] + compiler: [g++] tree: [sl] - # additional ARM configurations include: - - machine: raspberry - compiler: g++ - tree: sl - - - machine: mac-m1 - compiler: g++ - tree: sl - - machine: mac-i7 - compiler: g++ - tree: sl - + - {machine: x64_linux, compiler: g++-9, tree: sl} + - {machine: x64_linux, compiler: g++-10, tree: sl} + - {machine: x64_linux, compiler: g++-11, tree: sl} + - {machine: x64_linux, compiler: g++-12, tree: sl} + runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] env: @@ -265,50 +198,23 @@ jobs: strategy: fail-fast: false matrix: - machine: [xeon, tripper] - compiler: [g++-9, g++-10, g++-11] + machine: [xeon, x64_linux, arm64_linux, x64_mac, arm64_mac] + compiler: [g++] tree: [sl, upgma, slink, nj] - # additional ARM configurations include: - - machine: raspberry - compiler: g++ - tree: sl - - machine: raspberry - compiler: g++ - tree: upgma - - machine: raspberry - compiler: g++ - tree: slink - - machine: raspberry - compiler: g++ - tree: nj - - - machine: mac-m1 - compiler: g++ - tree: sl - - machine: mac-m1 - compiler: g++ - tree: upgma - - machine: mac-m1 - compiler: g++ - tree: slink - - machine: mac-m1 - compiler: g++ - tree: nj - - - machine: mac-i7 - compiler: g++ - tree: sl - - machine: mac-i7 - compiler: g++ - tree: upgma - - machine: mac-i7 - compiler: g++ - tree: slink - - machine: mac-i7 - compiler: g++ - tree: nj - + - {machine: x64_linux, compiler: g++-9, tree: sl} + - {machine: x64_linux, compiler: g++-9, tree: upgma} + - {machine: x64_linux, compiler: g++-9, tree: nj} + - {machine: x64_linux, compiler: g++-10, tree: sl} + - {machine: x64_linux, compiler: g++-10, tree: upgma} + - {machine: x64_linux, compiler: g++-10, tree: nj} + - {machine: x64_linux, compiler: g++-11, tree: sl} + - {machine: x64_linux, compiler: g++-11, tree: upgma} + - {machine: x64_linux, compiler: g++-11, tree: nj} + - {machine: x64_linux, compiler: g++-12, tree: sl} + - {machine: x64_linux, compiler: g++-12, tree: upgma} + - {machine: x64_linux, compiler: g++-12, tree: nj} + runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] env: @@ -345,21 +251,14 @@ jobs: strategy: fail-fast: false matrix: - machine: [xeon, tripper] - compiler: [g++-9, g++-11] + machine: [xeon, x64_linux, arm64_linux, x64_mac, arm64_mac] + compiler: [g++] tree: [sl] - # additional ARM configurations include: - - machine: raspberry - compiler: g++ - tree: sl - - - machine: mac-m1 - compiler: g++ - tree: sl - - machine: mac-i7 - compiler: g++ - tree: sl + - {machine: x64_linux, compiler: g++-9, tree: sl} + - {machine: x64_linux, compiler: g++-10, tree: sl} + - {machine: x64_linux, compiler: g++-11, tree: sl} + - {machine: x64_linux, compiler: g++-12, tree: sl} runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] @@ -408,17 +307,13 @@ jobs: strategy: fail-fast: false matrix: - machine: [xeon, tripper] - compiler: [g++-9, g++-10, g++-11] - # additional ARM configurations + machine: [xeon, x64_linux, arm64_linux, x64_mac, arm64_mac] + compiler: [g++] include: - - machine: raspberry - compiler: g++ - - - machine: mac-m1 - compiler: g++ - - machine: mac-i7 - compiler: g++ + - {machine: x64_linux, compiler: g++-9} + - {machine: x64_linux, compiler: g++-10} + - {machine: x64_linux, compiler: g++-11} + - {machine: x64_linux, compiler: g++-12} runs-on: [self-hosted, famsa, '${{ matrix.machine }}'] @@ -476,12 +371,12 @@ jobs: ######################################################################################## noavx-tests: name: distances only - different TRipper SIMD extensions - runs-on: [self-hosted, famsa, tripper] + runs-on: [self-hosted, famsa, x64_linux] needs: small-tests strategy: fail-fast: false matrix: - compiler: [g++-9, g++-10, g++-11] + compiler: [g++-9, g++-10, g++-11, g++-12, g++-13] platform: [none, sse4, avx] env: @@ -507,17 +402,14 @@ jobs: strategy: fail-fast: false matrix: - machine: [xeon, tripper] - compiler: [g++-9, g++-11] + machine: [xeon, x64_linux, arm64_linux, x64_mac, arm64_mac] + compiler: [g++] tree: [sl] - include: - - machine: mac-m1 - compiler: g++ - tree: sl - - machine: mac-i7 - compiler: g++ - tree: sl + - {machine: x64_linux, compiler: g++-9, tree: sl} + - {machine: x64_linux, compiler: g++-10, tree: sl} + - {machine: x64_linux, compiler: g++-11, tree: sl} + - {machine: x64_linux, compiler: g++-12, tree: sl} env: REF_DIR: ./test/LRR diff --git a/makefile b/makefile index 9dc1fca..5760010 100644 --- a/makefile +++ b/makefile @@ -116,7 +116,7 @@ INCLUDES=$(foreach d, $(INC_DIRS), -I$d) ifeq ($(STATIC_LINK), true) CXXFLAGS = -Wall -Wno-char-subscripts -Wno-attributes -O3 $(COMMON_FLAGS) $(DEFINE_FLAGS) -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -std=$(CPP_STD) $(INCLUDES) - CLINK = -lm -static -O3 -msse4 -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -std=$(CPP_STD) + CLINK = -lm -static -O3 -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -std=$(CPP_STD) else CXXFLAGS = -Wall -Wno-char-subscripts -Wno-attributes -O3 $(COMMON_FLAGS) $(DEFINE_FLAGS) -std=$(CPP_STD) -pthread $(INCLUDES) CLINK = -lm $(CLINK_FLAGS) -O3 $(COMMON_FLAGS) -std=$(CPP_STD) -pthread diff --git a/src/core/sequence.cpp b/src/core/sequence.cpp index 683dfc7..54401be 100644 --- a/src/core/sequence.cpp +++ b/src/core/sequence.cpp @@ -231,6 +231,7 @@ CGappedSequence::CGappedSequence(const string& _id, const string& seq, int seq_n symbols=(symbol_t*)mma->allocate(symbols_size + 1);} else { symbols=new symbol_t[symbols_size +1];} + symbols[0]=GUARD; } else { symbols=nullptr; @@ -255,10 +256,10 @@ CGappedSequence::CGappedSequence(const string& _id, const string& seq, int seq_n char* q = find(mapping_table, mapping_table + 25, c); if (q == mapping_table + 25) { extra_symbols.emplace_back(is, c); // save non-standard symbol - symbols[is] = (symbol_t)UNKNOWN_SYMBOL; + symbols[is+1] = (symbol_t)UNKNOWN_SYMBOL; } else { - symbols[is] = (symbol_t)(q - mapping_table); + symbols[is+1] = (symbol_t)(q - mapping_table); } ++is; @@ -313,7 +314,7 @@ CGappedSequence::CGappedSequence(const CGappedSequence& _gapped_sequence) : symbols = new symbol_t[symbols_size + 1]; - copy_n(_gapped_sequence.symbols, symbols_size, symbols); + copy_n(_gapped_sequence.symbols, symbols_size + 1, symbols); n_gaps = _gapped_sequence.n_gaps; dps = _gapped_sequence.dps; diff --git a/src/core/version.h b/src/core/version.h index eab6d1d..2c237a9 100644 --- a/src/core/version.h +++ b/src/core/version.h @@ -9,14 +9,17 @@ Authors: Sebastian Deorowicz, Agnieszka Debudaj-Grabysz, Adam Gudys #ifndef _VERSION_H #define _VERSION_H -#define FAMSA_VER "2.2.2" -#define FAMSA_DATE "2022-10-09" +#define FAMSA_VER "2.2.3" +#define FAMSA_DATE "2024-09-17" #define FAMSA_AUTHORS "S. Deorowicz, A. Debudaj-Grabysz, A. Gudys" #endif /* Version history: +2.2.3 (2024-09-17): +- Fixed rare bug in single linkage when analyzing sequences with zero similarity. Release deployment scripts added. + 2.2.2 (2022-10-09): - Fixed slowdown caused by the duplicate removal (feature added in 2.1.0).