Skip to content

Commit

Permalink
Fix endless loop in rescorediagonal
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-steinegger committed Apr 9, 2021
1 parent 4462533 commit 1d77028
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/alignment/rescorediagonal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ int doRescorediagonal(Parameters &par,
if (totalMemory > resultReader.getTotalDataSize()) {
flushSize = resultReader.getSize();
}
size_t iterations = static_cast<int>(ceil(static_cast<double>(dbSize) / static_cast<double>(flushSize)));


size_t iterations = 1;
if(flushSize > 0){
iterations = static_cast<int>(ceil(static_cast<double>(dbSize) / static_cast<double>(flushSize)));
}

for (size_t i = 0; i < iterations; i++) {
size_t start = dbFrom + (i * flushSize);
size_t bucketSize = std::min(dbSize - (i * flushSize), flushSize);
Expand Down

0 comments on commit 1d77028

Please sign in to comment.