r280: align two ends in the same thread

Otherwise odd-number threads may be of different speed from even-number threads.
This commit is contained in:
Heng Li 2013-02-25 15:40:15 -05:00
parent 20aa848b3c
commit d19e834d84
2 changed files with 10 additions and 3 deletions

View File

@ -680,8 +680,15 @@ static void *worker1(void *data)
{
worker_t *w = (worker_t*)data;
int i;
for (i = w->start; i < w->n; i += w->step)
w->regs[i] = mem_align1(w->opt, w->bwt, w->bns, w->pac, w->seqs[i].l_seq, w->seqs[i].seq);
if (!(w->opt->flag&MEM_F_PE)) {
for (i = w->start; i < w->n; i += w->step)
w->regs[i] = mem_align1(w->opt, w->bwt, w->bns, w->pac, w->seqs[i].l_seq, w->seqs[i].seq);
} else { // for PE we align the two ends in the same thread in case the 2nd read is of worse quality, in which case some threads may be faster/slower
for (i = w->start; i < w->n>>1; i += w->step) {
w->regs[i<<1|0] = mem_align1(w->opt, w->bwt, w->bns, w->pac, w->seqs[i<<1|0].l_seq, w->seqs[i<<1|0].seq);
w->regs[i<<1|1] = mem_align1(w->opt, w->bwt, w->bns, w->pac, w->seqs[i<<1|1].l_seq, w->seqs[i<<1|1].seq);
}
}
return 0;
}

2
main.c
View File

@ -4,7 +4,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.6.2-r279-beta"
#define PACKAGE_VERSION "0.6.2-r280-beta"
#endif
static int usage()