From deaea0e595a6717525f1fad4cf3f47a8ffd07f29 Mon Sep 17 00:00:00 2001 From: BenLangmead Date: Mon, 16 Oct 2017 15:46:53 -0400 Subject: [PATCH 1/3] promote chunk_size to int64_t to avoid int overflow at >214 threads --- bwamem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bwamem.h b/bwamem.h index fb572b28..eb5e8d82 100644 --- a/bwamem.h +++ b/bwamem.h @@ -43,7 +43,7 @@ typedef struct { int max_occ; // skip a seed if its occurence is larger than this value int max_chain_gap; // do not chain seed if it is max_chain_gap-bp away from the closest seed int n_threads; // number of threads - int chunk_size; // process chunk_size-bp sequences in a batch + int64_t chunk_size; // process chunk_size-bp sequences in a batch float mask_level; // regard a hit as redundant if the overlap with another better hit is over mask_level times the min length of the two hits float drop_ratio; // drop a chain if its seed coverage is below drop_ratio times the seed coverage of a better chain overlapping with the small chain float XA_drop_ratio; // when counting hits for the XA tag, ignore alignments with score < XA_drop_ratio * max_score; only effective for the XA tag From db35d8cf653a4c291c68e35d6c463325b3c576f1 Mon Sep 17 00:00:00 2001 From: BenLangmead Date: Mon, 16 Oct 2017 15:53:51 -0400 Subject: [PATCH 2/3] allow # bases read by bseq_read to exceed 2^31 --- bwa.c | 2 +- bwa.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bwa.c b/bwa.c index 75ccdf44..accd52cd 100644 --- a/bwa.c +++ b/bwa.c @@ -49,7 +49,7 @@ static inline void kseq2bseq1(const kseq_t *ks, bseq1_t *s) s->l_seq = ks->seq.l; } -bseq1_t *bseq_read(int chunk_size, int *n_, void *ks1_, void *ks2_) +bseq1_t *bseq_read(int64_t chunk_size, int *n_, void *ks1_, void *ks2_) { kseq_t *ks = (kseq_t*)ks1_, *ks2 = (kseq_t*)ks2_; int size = 0, m, n; diff --git a/bwa.h b/bwa.h index aa21725e..04702882 100644 --- a/bwa.h +++ b/bwa.h @@ -39,7 +39,7 @@ extern char bwa_rg_id[256]; extern "C" { #endif - bseq1_t *bseq_read(int chunk_size, int *n_, void *ks1_, void *ks2_); + bseq1_t *bseq_read(int64_t chunk_size, int *n_, void *ks1_, void *ks2_); void bseq_classify(int n, bseq1_t *seqs, int m[2], bseq1_t *sep[2]); void bwa_fill_scmat(int a, int b, int8_t mat[25]); From 2e3a068dea8d0f95d1eeb98a62629e62b2a6bce6 Mon Sep 17 00:00:00 2001 From: BenLangmead Date: Mon, 16 Oct 2017 15:54:20 -0400 Subject: [PATCH 3/3] promote actual_chunk_size to int64_t --- fastmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastmap.c b/fastmap.c index 41c29cb0..9102a40b 100644 --- a/fastmap.c +++ b/fastmap.c @@ -25,7 +25,8 @@ typedef struct { mem_opt_t *opt; mem_pestat_t *pes0; int64_t n_processed; - int copy_comment, actual_chunk_size; + int copy_comment; + int64_t actual_chunk_size; bwaidx_t *idx; } ktp_aux_t;