Disable random map automatically if a non-uniform random distribution is given
[fio.git] / init.c
diff --git a/init.c b/init.c
index b3215f52fca3ebb2306c5e02e8437aac0a6d57fa..70217418ce5f75df75bc88a0cec2d7223a5d7183 100644 (file)
--- a/init.c
+++ b/init.c
@@ -317,6 +317,10 @@ static struct thread_data *get_new_job(int global, struct thread_data *parent,
        profile_add_hooks(td);
 
        td->thread_number = thread_number;
+
+       if (!parent || !parent->o.group_reporting)
+               stat_number++;
+
        return td;
 }
 
@@ -592,6 +596,13 @@ static int fixup_options(struct thread_data *td)
                td->o.compress_percentage = 0;
        }
 
+       /*
+        * Using a non-uniform random distribution excludes usage of
+        * a random map
+        */
+       if (td->o.random_distribution != FIO_RAND_DIST_RANDOM)
+               td->o.norandommap = 1;
+
        return ret;
 }
 
@@ -1198,7 +1209,7 @@ static int fill_def_thread(void)
 
        fio_getaffinity(getpid(), &def_thread.o.cpumask);
        def_thread.o.timeout = def_timeout;
-
+       def_thread.o.error_dump = 1;
        /*
         * fill default options
         */
@@ -1456,8 +1467,8 @@ int parse_cmd_line(int argc, char *argv[])
                        break;
                case 'V':
                        terse_version = atoi(optarg);
-                       if (!(terse_version == 2 || terse_version == 3) ||
-                            (terse_version == 4)) {
+                       if (!(terse_version == 2 || terse_version == 3 ||
+                            terse_version == 4)) {
                                log_err("fio: bad terse version format\n");
                                exit_val = 1;
                                do_exit++;