From: Bo Li Date: Sat, 2 Apr 2011 06:47:49 +0000 (-0500) Subject: fix a bug in partition reads for parallel X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=commitdiff_plain;h=a2a1417f57577d69c7d17c5fba40c2aa90510406 fix a bug in partition reads for parallel --- diff --git a/EM.cpp b/EM.cpp index 318b7eb..aa7ebdb 100644 --- a/EM.cpp +++ b/EM.cpp @@ -128,7 +128,7 @@ void init(ReadReader **&readers, HitContainer **&hitvs, doubl if (!readers[i]->locate(curnr)) { fprintf(stderr, "Read indices files do not match!\n"); exit(-1); } //assert(readers[i]->locate(curnr)); - while (nrLeft > ntLeft && hitvs[i]->getNHits() < nhT) { + while (nrLeft > ntLeft && (i == nThreads - 1 || hitvs[i]->getNHits() < nhT)) { if (!hitvs[i]->read(fin)) { fprintf(stderr, "Cannot read alignments from .dat file!\n"); exit(-1); } //assert(hitvs[i]->read(fin)); --nrLeft;