[Wien] segfault in lapw1

Peter Blaha pblaha at theochem.tuwien.ac.at
Fri Jun 29 19:49:28 CEST 2012


Thank you very much for your report. This was really useful !!!

I can verify that with ifort compiler 2011_sp1.10.319

the ilaenv command really returns 640   (which seems quite a nonsense, 
since the dimension of the matrix is only 154 in my example). In this 
case the errors described below (or in the mailing list) occur.

And yes, the proposed fix:
        IF (NB .GT. 128) NB = 128
seems to solve the problem. (better do it with "blocksize")

It should be mentioned, that the recommended compiler version 2011.3.174
returns 64 for this ilaenv call, which seems reasonable and does not 
lead to any problems.

So your findings explain nicely these recent compiler issues.
My only problem is, that   ilaenv  is used in several other parts of our 
code too (and probably also internally by some lapack/blas routines in 
the mkl).
So in case   ilaenv   is buggy, the proposed fix may solve this 
particular (or some other) problems, but I'm not sure it solves all...

PS: Dear Igor,

you may know if Intel has changed on purpose the blocking length (this 
is what ilaenv  should return) to such a huge number, or if you think 
this is some bug in the mkl-library or in some Linux c-libraries, which 
are used by the mkl.

In case this is NOT a bug, we have to carefully check all   ilaenv 
statements in the matrix-diagonalization parts of lapw1, supplement all 
of them with some check.


Am 29.06.2012 08:14, schrieb ARAI Masao:
>
> Dear all,
>
> when using intel compiler, I encountered error message "glibc
> detected *** lapw1: malloc(): memory corruption: 0x0000000001612a20".
>
> Similar error messages have been reported to mailing lists several
> times.
>
> I think that this error occurs because the WORK array defined in
> lapw1/seclr4.f is not sufficient.
>
> In lapw1/seclr4.f, the work array WORK is allocated as
>
>        LWORK = HSROWS*(BLOCKSIZE+3)
>        allocate( IFAIL(HSROWS), IWORK(LIWORK), WORK(LWORK), STAT=IERR )
>
> where the BLOCKSIZE is defined as
>
>          BLOCKSIZE = 128
>
> in modlues.F. (I assume non-Parallel case.)
>
> The WORK array is used in subroutine DSCGST.
>
> However, in lpaw1/dscgst.f, optimal blocksize is determined by the
> return value of ILAENV as
>
>        NB = ILAENV( 1, 'DSYGST', 'L', N, -1, -1, -1 )
>
> where the ILAENV is a routine in lapack library. (For intel compiler,
> it is in MKL library.) For my case, ILAENV return 640, which means
> that NB is much larger than the BLOCKSIZE. Therefore, the size of WORK
> array is not sufficient. If we reduce the NB in dscgst.f, the lapw1
> works correctly.
>
> I am not sure what is the suitable solution. Easy modification would
> be just to test if the return value of ILAENV is larger than the
> BLOCKSIZE and reduce NB, i.e.,
>
>
>        NB = ILAENV( 1, 'DSYGST', 'L', N, -1, -1, -1 )
>        IF (NB .GT. 128) NB = 128
>
> Similar modification may be also necessary in lapw1/zhcgst.f. (I have
> not tested.)
>
> Best regards,
>
> Masao ARAI
> Computational Materials Science Unit,
> National Institute for Materials Science
> Japan
>
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
>

-- 
Peter Blaha
Inst.Materials Chemistry
TU Vienna
Getreidemarkt 9
A-1060 Vienna
Austria
+43-1-5880115671




More information about the Wien mailing list