diff --git a/ebwt_build.cpp b/ebwt_build.cpp index c47603d..1cf3241 100644 --- a/ebwt_build.cpp +++ b/ebwt_build.cpp @@ -216,6 +216,7 @@ static int parseNumber(T lower, const char *errmsg) { static void parseOptions(int argc, const char **argv) { int option_index = 0; int next_option; + bool bmaxDivNSet = false; do { next_option = getopt_long( argc, const_cast(argv), @@ -261,6 +262,7 @@ static void parseOptions(int argc, const char **argv) { bmaxDivN = 0xffffffff; // don't use multSqrt break; case ARG_BMAX_DIV: + bmaxDivNSet = true; bmaxDivN = parseNumber(1, "--bmaxdivn arg must be at least 1"); bmax = OFF_MASK; // don't use bmax bmaxMultSqrt = OFF_MASK; // don't use multSqrt @@ -296,6 +298,9 @@ static void parseOptions(int argc, const char **argv) { << "extremely slow performance and memory exhaustion. Perhaps you meant to specify" << endl << "a small --bmaxdivn?" << endl; } + if (!bmaxDivNSet) { + bmaxDivN *= nthreads; + } } /**