Skip to content

Commit 73821b4

Browse files
committed
Merge branch 'bug_fixes'
2 parents da7b440 + 5a4d538 commit 73821b4

22 files changed

+335
-350
lines changed

.github/workflows/random_tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Run bowtie random tests for all commits to master on Ubuntu and MacOS
2+
on:
3+
push:
4+
branches:
5+
- 'master'
6+
paths:
7+
- '**.c'
8+
- '**.h'
9+
- '**.cpp'
10+
- 'bowtie'
11+
- 'bowtie-build'
12+
- 'bowtie-inspect'
13+
- 'Makefile'
14+
- 'scripts/test/**'
15+
pull_request:
16+
branches:
17+
- 'master'
18+
paths:
19+
- '**.c'
20+
- '**.h'
21+
- '**.cpp'
22+
- 'bowtie'
23+
- 'bowtie-build'
24+
- 'bowtie-inspect'
25+
- 'Makefile'
26+
- 'scripts/test/**'
27+
jobs:
28+
setup:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check out repository code
32+
uses: actions/checkout@v2
33+
- name: Install zlib development files
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install zlib1g-dev
37+
linux:
38+
runs-on: ubuntu-latest
39+
needs: setup
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Run random tests
43+
run: |
44+
make allall
45+
make random-test
46+
macos:
47+
runs-on: macos-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Run random tests
51+
run: |
52+
make allall
53+
make random-test

.github/workflows/simple_tests.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Run bowtie simple tests on Ubuntu and MacOS
2+
on:
3+
push:
4+
branches:
5+
- 'bug_fixes'
6+
- 'master'
7+
paths:
8+
- '**.c'
9+
- '**.h'
10+
- '**.cpp'
11+
- 'bowtie'
12+
- 'bowtie-build'
13+
- 'bowtie-inspect'
14+
- 'Makefile'
15+
- 'scripts/test/**'
16+
pull_request:
17+
branches:
18+
- 'master'
19+
paths:
20+
- '**.c'
21+
- '**.h'
22+
- '**.cpp'
23+
- 'bowtie'
24+
- 'bowtie-build'
25+
- 'bowtie-inspect'
26+
- 'Makefile'
27+
- 'scripts/test/**'
28+
jobs:
29+
setup:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Check out repository code
33+
uses: actions/checkout@v2
34+
- name: Install zlib development files
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install zlib1g-dev
38+
linux:
39+
runs-on: ubuntu-latest
40+
needs: setup
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: Run simple tests
44+
run: |
45+
make allall
46+
make simple-test
47+
macos:
48+
runs-on: macos-latest
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Run simple tests
52+
run: |
53+
make allall
54+
make simple-test

.travis.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,6 @@ branches:
77
- bug_fixes
88
matrix:
99
include:
10-
# Linux (gcc4.9)
11-
- os: linux
12-
language: python
13-
python: "3.4"
14-
dist: xenial
15-
addons:
16-
apt:
17-
sources:
18-
- ubuntu-toolchain-r-test
19-
packages:
20-
- g++-4.9
21-
- zlib1g-dev
22-
env:
23-
- CC=gcc-4.9
24-
- CXX=g++-4.9
25-
# Linux (gcc8)
26-
- os: linux
27-
language: python
28-
python: "3.8"
29-
addons:
30-
apt:
31-
sources:
32-
- ubuntu-toolchain-r-test
33-
packages:
34-
- g++-8
35-
- zlib1g-dev
36-
env:
37-
- CC=gcc-8
38-
- CXX=g++-8
39-
- CXXFLAGS="-fuse-ld=gold"
40-
# MacOS
41-
- os: osx
42-
osx_image: xcode11.2
43-
compiler: clang
44-
env:
45-
- CC=clang
46-
- CXX=clang++
47-
- NPROC="$(sysctl -n hw.activecpu)"
48-
before_install:
49-
- brew unlink python@2
5010
# ARM 64-bit
5111
- os: linux
5212
arch: arm64

Makefile

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ bindir = $(prefix)/bin
77

88
ARCH = $(shell uname -m)
99
INC = $(if $(RELEASE_BUILD),-I$(CURDIR)/.include) -I third_party
10-
LIBS = $(LDFLAGS) $(if $(RELEASE_BUILD),-L$(CURDIR)/.lib) -lz
10+
LIBS = $(LDFLAGS) $(if $(RELEASE_BUILD),-L$(CURDIR)/.lib) -lz -lpthread
1111
HEADERS = $(wildcard *.h)
1212
BOWTIE_MM = 1
1313
BOWTIE_SHARED_MEM = 1
@@ -65,25 +65,9 @@ SHMEM_DEF =
6565
ifeq (1,$(BOWTIE_SHARED_MEM))
6666
SHMEM_DEF = -DBOWTIE_SHARED_MEM
6767
endif
68-
PTHREAD_PKG =
69-
PTHREAD_LIB =
70-
PTHREAD_DEF =
7168

7269
ifeq (1,$(MINGW))
73-
PTHREAD_LIB =
7470
override EXTRA_FLAGS += -static-libgcc -static-libstdc++
75-
else
76-
PTHREAD_LIB = -lpthread
77-
endif
78-
79-
ifeq (1,$(NO_SPINLOCK))
80-
override EXTRA_FLAGS += -DNO_SPINLOCK
81-
endif
82-
83-
84-
LIBS += $(PTHREAD_LIB)
85-
ifeq (1, $(WITH_TBBMALLOC))
86-
LIBS += -ltbbmalloc
8771
endif
8872

8973
POPCNT_CAPABILITY ?= 1
@@ -92,7 +76,6 @@ ifeq (aarch64,$(shell uname -m))
9276
endif
9377
ifeq (1, $(POPCNT_CAPABILITY))
9478
override EXTRA_FLAGS += -DPOPCNT_CAPABILITY
95-
INC += -I third_party
9679
endif
9780

9881
PREFETCH_LOCALITY = 2
@@ -113,15 +96,16 @@ ifeq (1,$(WITH_THREAD_PROFILING))
11396
endif
11497

11598
OTHER_CPPS = ccnt_lut.cpp ref_read.cpp alphabet.cpp shmem.cpp \
116-
edit.cpp ebwt.cpp
99+
edit.cpp ebwt.cpp bt2_locks.cpp
117100

118-
ifneq (1, $(NO_SPINLOCK))
119-
OTHER_CPPS += bt2_locks.cpp
101+
ifeq (1,$(WITH_QUEUELOCK))
102+
NO_SPINLOCK = 1
103+
override EXTRA_FLAGS += -DWITH_QUEUELOCK
120104
endif
121105

122-
ifeq (1,$(WITH_QUEUELOCK))
123-
OTHER_CPPS += bt2_locks.cpp
124-
override EXTRA_FLAGS += -DWITH_QUEUELOCK=1
106+
ifeq (1,$(NO_SPINLOCK))
107+
$(info $(NO_SPINLOCK))
108+
override EXTRA_FLAGS += -DNO_SPINLOCK
125109
endif
126110

127111
ifeq (1,$(WITH_FINE_TIMER))
@@ -242,8 +226,8 @@ DEFS=-fno-strict-aliasing \
242226
$(SHMEM_DEF)
243227

244228
ALL_FLAGS = $(EXTRA_FLAGS) $(CFLAGS) $(CXXFLAGS)
245-
DEBUG_DEFS = -DCOMPILER_OPTIONS="\"$(DEBUG_FLAGS) $(ALL_FLAGS)\""
246-
RELEASE_DEFS = -DCOMPILER_OPTIONS="\"$(RELEASE_FLAGS) $(ALL_FLAGS)\""
229+
DEBUG_DEFS = -DCOMPILER_OPTIONS="\"$(DEBUG_FLAGS) $(EXTRA_FLAGS) $(CFLAGS) $(CXXFLAGS)\""
230+
RELEASE_DEFS = -DCOMPILER_OPTIONS="\"$(RELEASE_FLAGS) $(EXTRA_FLAGS) $(CFLAGS) $(CXXFLAGS)\""
247231

248232
#
249233
# bowtie-build targets

NEWS

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Bowtie NEWS
55

66
Bowtie is now available for download. 0.9.0 is the first version to
77
be released under the OSI Artistic License (see `LICENSE') and freely
8-
available to the public for download. The current version is 1.3.0.
8+
available to the public for download. The current version is 1.3.1.
99

1010
Reporting Issues
1111
================
@@ -23,6 +23,18 @@ Keep up with our releases on the GitHub releases page:
2323

2424
Version Release History
2525
=======================
26+
Version 1.3.1 - Sep 13, 2021
27+
28+
* Fixed an overflow issue in `bowtie-build` that would sometimes
29+
yield corrupt "large" (64-bit) indexes; the resulting index
30+
would sometimes cause `bowtie` to hang. Note: `bowtie2-build`
31+
does not have this issue.
32+
* Fixed an issue in `bowtie` causing XM:i SAM optional field to
33+
sometimes be off by 1 when using the `-m/-M` flags.
34+
* Fixed an issue that would sometimes cause deadlocks in `bowtie`
35+
when running multithreaded.
36+
* Fixed an issue causing build errors when compiling against
37+
a pre-C++11 standard.
2638

2739
Version 1.3.0 - Jul 22, 2020
2840

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.0
1+
1.3.1

bt2_locks.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
#include "bt2_locks.h"
2-
31
#if (__cplusplus >= 201103L)
42

5-
void mcs_lock::lock() {
3+
#include "bt2_locks.h"
4+
5+
void mcs_lock::lock(mcs_node &node) {
66
node.next = nullptr;
7-
node.unlocked = false;
87

9-
mcs_node *pred = q.exchange(&node, std::memory_order_release);
8+
mcs_node *pred = q.exchange(&node, std::memory_order_acq_rel);
109
if (pred) {
11-
pred->next = &node;
10+
node.unlocked = false;
11+
pred->next.store(&node, std::memory_order_release);
1212
spin_while_eq(node.unlocked, false);
1313
}
1414
node.unlocked.load(std::memory_order_acquire);
1515
}
1616

17-
void mcs_lock::unlock() {
18-
if (!node.next) {
17+
void mcs_lock::unlock(mcs_node &node) {
18+
if (!node.next.load(std::memory_order_acquire)) {
1919
mcs_node *node_ptr = &node;
2020
if (q.compare_exchange_strong(node_ptr,
2121
(mcs_node *)nullptr,
2222
std::memory_order_release))
2323
return;
2424
spin_while_eq(node.next, (mcs_node *)nullptr);
2525
}
26-
node.next->unlocked.store(true, std::memory_order_release);
26+
node.next.load(std::memory_order_acquire)->unlocked.store(true, std::memory_order_release);
2727
}
2828

29-
thread_local mcs_lock::mcs_node mcs_lock::node;
3029

3130
void spin_lock::lock() {
3231
cpu_backoff backoff;
@@ -37,4 +36,5 @@ void spin_lock::lock() {
3736
void spin_lock::unlock() {
3837
flag.clear(std::memory_order_release);
3938
}
39+
4040
#endif

bt2_locks.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,27 @@ class mcs_lock {
4848
public:
4949
mcs_lock(): q(nullptr) {}
5050
struct mcs_node {
51-
mcs_node *next;
51+
std::atomic<mcs_node *> next;
5252
std::atomic_bool unlocked;
5353
};
5454

55-
void lock();
56-
void unlock();
57-
typedef mcs_node* mcs_node_ptr;
55+
void lock(mcs_node &node);
56+
void unlock(mcs_node &node);
57+
typedef std::atomic<mcs_node *> mcs_node_ptr;
5858
private:
59-
void spin_while_eq(const volatile mcs_node_ptr& value, mcs_node *expected) {
59+
void spin_while_eq(const volatile mcs_node_ptr& value, const volatile mcs_node *expected) {
6060
cpu_backoff backoff;
61-
while (value == expected)
61+
while (value.load(std::memory_order_acquire) == expected)
6262
backoff.pause();
6363
}
6464

65-
void spin_while_eq(const volatile std::atomic_bool& value, bool expected) {
65+
void spin_while_eq(const volatile std::atomic_bool& value, const volatile bool expected) {
6666
cpu_backoff backoff;
6767
while (value.load(std::memory_order_acquire) == expected)
6868
backoff.pause();
6969
}
7070
std::atomic<mcs_node *> q;
71-
static thread_local mcs_node node;
7271
};
73-
#endif
72+
73+
#endif // if (__cplusplus >= 201103L)
7474
#endif // __MCS_LOCK_H__

doc/website/manual.ssi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1>Table of Contents</h1>
2-
<p>Bowtie 1.3.0</p>
2+
<p>Bowtie 1.3.1</p>
33

44
<nav id="TOC" role="doc-toc">
55
<ul>

doc/website/recent_news.ssi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<h2>1.3.1 - 09/13/2021</h2>
2+
<ul>
3+
<li>Fixed an overflow issue in <code>bowtie-build</code> that would sometimes yield corrupt "large" (64-bit) indexes; the resulting index would sometimes cause <code>bowtie</code> to hang. Note: <code>bowtie2-build</code> does not have this issue.</li>
4+
<li>Fixed an issue in <code>bowtie</code> causing XM:i SAM optional field to sometimes be off by 1 when using the <code><a href="manual.shtml#bowtie-options-m">-m</a>/<a href="manual.shtml#bowtie-options-M">-M</a></code> flags.</li>
5+
<li>Fixed an issue that would sometimes cause deadlocks in <code>bowtie</code> when running multithreaded.</li>
6+
<li>Fixed an issue causing build errors when compiling against a pre-C++11 standard.</li>
7+
</ul>
8+
19
<h2>1.3.0 - 07/22/2020</h2>
210
<ul>
311
<li>Fixed an issue causing <code>bowtie</code> to report incorrect results when using a Bowtie 2 index.</li>

doc/website/rhsidebar.ssi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
</tr>
1919
<tr>
2020
<td>
21-
<a href="https://sourceforge.net/projects/bowtie-bio/files/bowtie/1.3.0">Bowtie 1.3.0</a>
21+
<a href="https://sourceforge.net/projects/bowtie-bio/files/bowtie/1.3.1">Bowtie 1.3.1</a>
2222
</td>
2323
<td align="right">
24-
07/22/20
24+
09/13/21
2525
</td>
2626
</tr>
2727
<tr>

0 commit comments

Comments
 (0)