diff --git a/timing/timing.c b/timing/timing.c
index ca5f3d1b7e646f46f4f086963a1c32b5e8805950..13cebf7c9742641c2ac22030d6a7b4b0bcc9ad0f 100644
--- a/timing/timing.c
+++ b/timing/timing.c
@@ -496,7 +496,7 @@ set_iparam_default(int *iparam){
     iparam[IPARAM_THRDNBR       ] = -1;
     iparam[IPARAM_THRDNBR_SUBGRP] = 1;
     iparam[IPARAM_M             ] = -1;
-    iparam[IPARAM_N             ] = 500;
+    iparam[IPARAM_N             ] = -1;
     iparam[IPARAM_K             ] = 1;
     iparam[IPARAM_LDA           ] = -1;
     iparam[IPARAM_LDB           ] = -1;
@@ -624,7 +624,8 @@ parse_arguments(int *_argc, char ***_argv, int *iparam, int *start, int *stop, i
 
 int
 main(int argc, char *argv[]) {
-    int i, m, mx, nx;
+    int i, m, n, mx, nx;
+    int status;
     int nbnode = 1;
     int start =  500;
     int stop  = 5000;
@@ -644,6 +645,7 @@ main(int argc, char *argv[]) {
     }
 #endif
 
+    n  = iparam[IPARAM_N];
     m  = iparam[IPARAM_M];
     mx = iparam[IPARAM_MX];
     nx = iparam[IPARAM_NX];
@@ -709,26 +711,41 @@ main(int argc, char *argv[]) {
 
     if (step < 1) step = 1;
 
-    int status = Test( -1, iparam ); /* print header */
+    status = Test( -1, iparam ); /* print header */
     if (status != MORSE_SUCCESS) return status;
-    for (i = start; i <= stop; i += step)
-    {
-        if ( nx > 0 ) {
-            iparam[IPARAM_M] = i;
-            iparam[IPARAM_N] = chameleon_max(1, i/nx);
-        } else if ( mx > 0 ) {
-            iparam[IPARAM_M] = chameleon_max(1, i/mx);
-            iparam[IPARAM_N] = i;
-        } else {
-            if ( m == -1 )
+    if ( n == -1 ){
+        for (i = start; i <= stop; i += step)
+        {
+            if ( nx > 0 ) {
                 iparam[IPARAM_M] = i;
-            iparam[IPARAM_N] = i;
+                iparam[IPARAM_N] = chameleon_max(1, i/nx);
+            }
+            else if ( mx > 0 ) {
+                iparam[IPARAM_M] = chameleon_max(1, i/mx);
+                iparam[IPARAM_N] = i;
+            }
+            else {
+                if ( m == -1 ) {
+                    iparam[IPARAM_M] = i;
+                }
+                iparam[IPARAM_N] = i;
+            }
+            status = Test( iparam[IPARAM_N], iparam );
+            if (status != MORSE_SUCCESS) {
+                return status;
+            }
+            success += status;
         }
-        int status = Test( iparam[IPARAM_N], iparam );
+    }
+    else {
+        if ( m == -1 ) {
+            iparam[IPARAM_M] = n;
+        }
+        iparam[IPARAM_N] = n;
+        status = Test( iparam[IPARAM_N], iparam );
         if (status != MORSE_SUCCESS) return status;
         success += status;
     }
-
     MORSE_Finalize();
     return success;
 }