[LTP] [PATCH v1] realtime:matrix_multi: main function to return exit status

Joerg Vehlow lkml@jv-coder.de
Fri Nov 12 13:07:54 CET 2021


Hi,

is the test even returning any valid results anywhere?
I don't know if systems are running too fast for the test nowadays,
but in my tests, they always divide by 0, even with very high iteration 
counts even in qemu.

e.g:

$ matrix_mult -i10000000

---------------------------------------
Matrix Multiplication (SMP Performance)
---------------------------------------

Running 10000000 iterations
Matrix Dimensions: 100x100
Calculations per iteration: 8
Number of CPUs: 4

Running sequential operations
Min: 0 us
Max: 160 us
Avg: 0.0000 us
StdDev: 0.2082 us

Running concurrent operations
Min: 0 us
Max: 1693 us
Avg: 0.0000 us
StdDev: 0.6652 us

Concurrent Multipliers:
Min: -nan
Max: 0.0945
Avg: -nan

Criteria: 3.00 * average concurrent time < average sequential time
Result: FAIL



If this is not a result of my test system, we should probably remove the 
test from the
profile, at least as long as it was not fixed.

Joerg


On 9/13/2021 5:31 PM, Bogdan Lezhepekov via ltp wrote:
> The original version always returned 0.
>
> Signed-off-by: Bogdan Lezhepekov <bogdan.lezhepekov@suse.com>
> ---
>   testcases/realtime/func/matrix_mult/matrix_mult.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c b/testcases/realtime/func/matrix_mult/matrix_mult.c
> index 61ab887fc..e702c0ff9 100644
> --- a/testcases/realtime/func/matrix_mult/matrix_mult.c
> +++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
> @@ -188,7 +188,7 @@ void *concurrent_thread(void *thread)
>   	return NULL;
>   }
>   
> -void main_thread(void)
> +int main_thread(void)
>   {
>   	int ret, i, j;
>   	nsec_t start, end;
> @@ -308,7 +308,7 @@ void main_thread(void)
>   	     criteria);
>   	printf("Result: %s\n", ret ? "FAIL" : "PASS");
>   
> -	return;
> +	return ret;
>   }
>   
>   int main(int argc, char *argv[])
> @@ -319,7 +319,7 @@ int main(int argc, char *argv[])
>   	numcpus = sysconf(_SC_NPROCESSORS_ONLN);
>   	/* the minimum avg concurrent multiplier to pass */
>   	criteria = pass_criteria * numcpus;
> -	int new_iterations;
> +	int new_iterations, ret;
>   
>   	if (iterations <= 0) {
>   		fprintf(stderr, "iterations must be greater than zero\n");
> @@ -348,7 +348,7 @@ int main(int argc, char *argv[])
>   	printf("Number of CPUs: %u\n", numcpus);
>   
>   	set_priority(PRIO);
> -	main_thread();
> +	ret = main_thread();
>   
> -	return 0;
> +	return ret;
>   }



More information about the ltp mailing list