Assignment 2 task 1

Assignment 2 task 1

by Hassan Rady -
Number of replies: 1

Dear PTfS team,

It stated that the length of each array is dependent on the value of "k" which is in the "NITER" loop meaning the initialization of the arrays is inside that loop; however, the time starts outside that loop, isn't that going to affect the measurements of Flops loop? Can I  measure the initialization part and substitute it from the wc time? Or is the "k" mentioned here not related to the code because the if condition is not required in the above understanding? Please clarify.

Thanks in advanced.

Kind regards

Hassan Rady

In reply to Hassan Rady

Re: Assignment 2 task 1

by Georg Hager -

The k in the code snippet is not the same as the k in the expression for the array length; my bad. I've corrected the text to use "r" in the array size expression.

That said, of course the allocation and initialization of the arrays must not be within the timed part of the program. We only want to benchmark the execution, not the initialization.