Commit 34fc7ab4 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix --n_range option in timing

parent b7ab8c09
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment