Inlen ComposerXE (ver. 12) : optimazation error |
- Date: 2011/08/26 00:53
- Name: A. M. Ito
- Dear Prof. Dr. Ozaki
I am Atsushi M. Ito in National Institute for Fusion Science(NIFS), Japan. Thank you very much for your distribution of OpenMX.
I started using the OpenMX with Intel Compiler and MKL, and I report calculation error by optimazation of the compiler. I think that the error is not bug of OpenMX.
The error is that the calculation result "Utot" diverges only under following conditions: (1) Using VPS and PAO datatbase Ver. 2006. The present calculation is Tungsten BCC material(2 x 2 x 2 unit cell = 16 atoms). (2) intel compiler command in "makefile" is "CC = icc -O2 -Dnompi -Dnoomp -mkl=sequential" and "LIB = "(empty). MKL linking is perhaps OK. If Option for Optimazation is "-O2" and "-O3" then "Utot" diverges, while it is "-O0" and "-O1" then "Utot" becomes correct result. (3) Intel Compiler version 12.0.0 to 12.0.5 (Composer XE) brought this error, where compile is successful. However The intel compiler version 11.1 worked out correct result.
Though (sorry for) I check only this in our workstation (CentOS 5, Intel Xeon X5680), The couse for the divergence of "Utot" is missing to copy array in function "Eigen_HH" of "EigenBand_lapack.c". To be concrete, the copy routine at line 248 to 251 seems to be skipped. I check by output as follows:
/*------------------------------------------*/ for (i=1; i<=n; i++){ D[i-1] = ad[i][i ].r; E[i-1] = ad[i][i+1].r; } ////debg print//// printf("debug:D[1],E[1],ad[2][2],ad[2][3]=%lf,%lf,%lf,%lf\n",D[1],E[1],ad[2][2].r,ad[2][3].r); ////debug print finish//// /*--------------------------------------------*/
Here, when "Utot" diverges, D[1] and E[1] are not equal to ad[2][2].r,ad[2][3].r, respectively. To avoid this error, I found two empirical way; (1) Define "D" and "E" with volatile (but I do not understand resister tuning). (2) Change copy source from "ad" to "ac" because "ad" is also copied from "ac" just before this routine. /*------------------------------------------*/ for (i=1; i<=n; i++){ D[i-1] = ac[i][i ].r; //org is: ad[i][i ].r E[i-1] = ac[i][i+1].r; //org is: ad[i][i+1].r } /*------------------------------------------*/
I can not understand why this empirical ways lead correct result. I am concerned about that after "D" and "E" is copied from ad in the above routine, they are used only argument of FORTRAN functions for lapack. Intel compiler cannot find relationship maybe.
I think that this error is not bug of OpenMX. Then I do not request to fix. But I think this report is maybe helpful for development and user of OpenMX.
Best regards.
| |