I wrote a small code calling the RCI CG routine with the ILU0 preconditioner. The code is attached. The code returns an incorrect vector of all zeros as a solution. I have noticed that the vector tmp contains the correct solution but it is not transfered to the vector x (= solution).
Zbigniew
Link Copied
is that linux or windows?
Hi,
I see that you call dcg_get to return correct value of solution, but dcg_get return only current number of iteration
INTEGER. Returns the current iteration number.
Thanks,
Alex
It is Linux (64-bit).
Here is my output:
tmp: tmp[0]=-0.0909091, tmp[1]=-0.181818, tmp[2]=-0.272727, tmp[3]=-0.363636, tmp[4]=-0.454545, tmp[5]=-0.545455, tmp[6]=-0.636364, tmp[7]=-0.727273, tmp[8]=-0.818182, tmp[9]=-0.909091, # of iterations = 0 solution x: x[0]=0, x[1]=0, x[2]=0, x[3]=0, x[4]=0, x[5]=0, x[6]=0, x[7]=0, x[8]=0, x[9]=0,
It is evident that the solution (x) is not correct.
Zbigniew
I should have asked the question "A bug in dcg?" because it is dcg which returns an incorrect solution (all zeros).
Also, why the number of iterations is 0?
Zbigniew
For more complete information about compiler optimizations, see our Optimization Notice.