[Wien] segfault in lapw1
ARAI Masao
arai.masao at nims.go.jp
Fri Jun 29 08:14:35 CEST 2012
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
More information about the Wien
mailing list