JulesKouatchou / basic_language_comparison

Other
85 stars 21 forks source link

Jacobi iteration benchmark implementation not correct #8

Open PetrKryslUCSD opened 3 years ago

PetrKryslUCSD commented 3 years ago

I compare here the C-language implementation and Julia.

I noticed that the number of sweeps executed by these two implementations was different. I tracked it down to the return line in timeStep4_Jacobi: this C function fails to return the square root of the error accumulator, which the Julia functions do. Hence, when the error is compared with the tolerance, the C-language implementation exits the while loop much sooner. The number of sweeps is consequently not equal between the implementations, which invalidates the comparison.

I think it would be best for the benchmark to fix the number of sweeps and not test the error in the loop condition.