 
 #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());

        Reads reads;

        log_info(stderr,"  reading input... started\n");

        // NOTE: at the moment the forward and reverse strands are not interleaved: we place
        // first all the forward and then all the reverse strands - might want to fix this.

        uint32       encoding_flags  = 0u;
        if (forward) encoding_flags |= io::FORWARD;

        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, "   -t       | --threads       int       [auto]\n");
        log_info(stderr, "   -F       | --skip-forward\n");
        log_info(stderr, "   -R       | --skip-reverse\n");
        log_info(stderr, "  output formats:\n");
