r149: introduced debugging flags on CLI

This commit is contained in:
Heng Li 2017-07-03 11:02:32 -04:00
parent 2e4fd9f1d0
commit 53c4bf5e4f
5 changed files with 15 additions and 6 deletions

10
main.c
View File

@ -10,7 +10,7 @@
#include "minimap.h"
#include "mmpriv.h"
#define MM_VERSION "2.0-r148-pre"
#define MM_VERSION "2.0-r149-pre"
void liftrlimit()
{
@ -45,6 +45,8 @@ static struct option long_options[] = {
{ "bucket-bits", required_argument, 0, 0 },
{ "mb-size", required_argument, 0, 0 },
{ "int-rname", no_argument, 0, 0 },
{ "no-kalloc", no_argument, 0, 0 },
{ "print-qname", no_argument, 0, 0 },
{ "version", no_argument, 0, 'V' },
{ "min-count", required_argument, 0, 'n' },
{ "min-chain-score",required_argument, 0, 'm' },
@ -94,8 +96,10 @@ int main(int argc, char *argv[])
else if (c == 'E') opt.e = atoi(optarg);
else if (c == 'z') opt.zdrop = atoi(optarg);
else if (c == 's') opt.min_dp_max = atoi(optarg);
else if (c == 0 && long_idx == 0) bucket_bits = atoi(optarg); // bucket-bits
else if (c == 0 && long_idx == 2) keep_name = 0; // int-rname
else if (c == 0 && long_idx == 0) bucket_bits = atoi(optarg); // --bucket-bits
else if (c == 0 && long_idx == 2) keep_name = 0; // --int-rname
else if (c == 0 && long_idx == 3) mm_dbg_flag |= MM_DBG_NO_KALLOC; // --no-kalloc
else if (c == 0 && long_idx == 4) mm_dbg_flag |= MM_DBG_PRINT_QNAME; // --print-qname
else if (c == 'V') {
puts(MM_VERSION);
return 0;

5
map.c
View File

@ -64,7 +64,7 @@ mm_tbuf_t *mm_tbuf_init(void)
{
mm_tbuf_t *b;
b = (mm_tbuf_t*)calloc(1, sizeof(mm_tbuf_t));
if (mm_verbose < 10) b->km = km_init();
if (!(mm_dbg_flag & 1)) b->km = km_init();
b->sdb = sdust_buf_init(b->km);
return b;
}
@ -262,7 +262,6 @@ mm_reg1_t *mm_map_frag(const mm_mapopt_t *opt, const mm_idx_t *mi, mm_tbuf_t *b,
mm_reg1_t *mm_map(const mm_idx_t *mi, int l_seq, const char *seq, int *n_regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *qname)
{
mm_reg1_t *regs;
if (mm_verbose >= 11) fprintf(stderr, "===> %s <===\n", qname);
b->mini.n = 0;
mm_sketch(b->km, seq, l_seq, mi->w, mi->k, 0, mi->is_hpc, &b->mini);
if (opt->sdust_thres > 0)
@ -295,6 +294,8 @@ typedef struct {
static void worker_for(void *_data, long i, int tid) // kt_for() callback
{
step_t *step = (step_t*)_data;
if (mm_dbg_flag & MM_DBG_PRINT_QNAME)
fprintf(stderr, "Processing query %s on thread %d\n", step->seq[i].name, tid);
step->reg[i] = mm_map(step->p->mi, step->seq[i].l_seq, step->seq[i].seq, &step->n_reg[i], step->buf[tid], step->p->opt, step->seq[i].name);
}

View File

@ -93,7 +93,7 @@ typedef struct {
int mid_occ;
} mm_mapopt_t;
extern int mm_verbose;
extern int mm_verbose, mm_dbg_flag;
extern double mm_realtime0;
struct mm_tbuf_s;

1
misc.c
View File

@ -3,6 +3,7 @@
#include "minimap.h"
int mm_verbose = 3;
int mm_dbg_flag = 0;
double mm_realtime0;
double cputime()

View File

@ -8,6 +8,9 @@
#define MM_PARENT_UNSET (-1)
#define MM_PARENT_TMP_PRI (-2)
#define MM_DBG_NO_KALLOC 0x1
#define MM_DBG_PRINT_QNAME 0x2
#ifndef kroundup32
#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x))
#endif