 
 #ifdef _OPENMP
         // now set the number of CPU threads
-        omp_set_num_threads( omp_get_num_procs() );
+        omp_set_num_threads( threads > 0 ? threads : omp_get_num_procs() );
         #pragma omp parallel
         {
             log_verbose(stderr, "  running on multiple threads (%d)\n", omp_get_thread_num());

        log_info(stderr, "   -cpu-mem | --cpu-memory    int (MB)  [8192]\n");
        log_info(stderr, "   -gpu-mem | --gpu-memory    int (MB)  [2048]\n");
        log_info(stderr, "   -c       | --compression   string    [1R]   (e.g. \"1\", ..., \"9\", \"1R\")\n");
        log_info(stderr, "   -F       | --skip-forward\n");
        log_info(stderr, "   -R       | --skip-reverse\n");
        log_info(stderr, "  output formats:\n");

                 (strcmp( argv[i], "--compression" )  == 0))  // setup compression level
        {
            comp_level = argv[++i];
        }
        else if ((strcmp( argv[i], "-t" )             == 0) ||
                 (strcmp( argv[i], "--threads" )      == 0))  // setup number of threads
        {
            threads = atoi( argv[++i] );
        }
    }

