[Wien] memory managment and ifc 8.0

Peter Blaha pblaha at zeus.theochem.tuwien.ac.at
Fri Oct 15 17:55:42 CEST 2004


Hi,
I could verify this problem and it happens for ifort8.1, not for ifc7.1

On the other hand I believe it is more or less "valid" f90 (besides the
complex*16 pointers ???). In any case, the reallocate routines are used
frequently for integer and double  precision arrays and there are no 
problems, even with ifort8.1. Only doreallocate_warp_c16_d2x3 fails,
and as far as I see it is the only complex*16,pointer array.

I see two simple fixes: Either set KMAX3START big enough in param.inc_r/c
(very unconvenient, indeed), or use your fix (I have not tested it myself),
or my version below (BUT beware: this DOES NOT WORK on ifc7.1 (does not 
allow to allocate array tf again)!!).
The extra copy time should not be, however, at the moment I would
not like to change the "master code" because of a buggy ifort compiler,
unless somebody can convince me, that this is against f90 norm.

It would also be interesting if other ifort8.1 users experience 
segmentation fault errors in other programs (there were messages about 
lapw0 ?), if they could trace this and see if it also happens in some 
reallocate step. 


Thanks for the mail and your good analysis.

PS: If somebody bought the ifort compiler and can request support, it might
be nice to construct a small example and demonstrate this failure to Intel.


          subroutine doreallocate_warp_c16_d2x3(tf, n1a, n1b, n2a, n2b, n3a, n3b)
            implicit none
            complex*16, pointer :: hilfsfeld(:,:,:), tf(:,:,:)
  !          complex*16, allocatable :: hilfsfeld(:,:,:), tf(:,:,:)
            integer min1, n1a, n1b, n2a, n2b, n3a, n3b
            allocate( hilfsfeld(-n1b:n1b, -n2b:n2b, -n3b:n3b) )
            hilfsfeld(-n1b:n1b, -n2b:n2b, -n3b:n3b)=(0.0D0,0.0D0)
            hilfsfeld(-n1a:n1a,-n2a:n2a,-n3a:n3a)=tf(-n1a:n1a,-n2a:n2a,-n3a:n3a)
            deallocate(tf)
!            allocate (tf(-n1b:n1b, -n2b:n2b, -n3b:n3b))
 !           tf=hilfsfeld
            tf=>hilfsfeld
          end subroutine

> Did anybody test the code compiled with intel fortran compiler 8.0 on large
> unit cells?
> my test calculation of Cu 111 surface I need KMAX3START to be large than
> ~170 and

> but this is not interesting. What interesting is that lapw1 will crash in 
> 
> doreallocate_warp_c16_d2x3 when it is called from setwarts. This is a line 
> 
> where it happens
> 
> hilfsfeld(-n1a:n1a,-n2a:n2a,-n3a:n3a)=tf(-n1a:n1a,-n2a:n2a,-n3a:n3a)
> 
> Note that this is ifc 8.0 specific behavior. In 7.1 everything is fine.

                                      P.Blaha
--------------------------------------------------------------------------
Peter BLAHA, Inst.f. Materials Chemistry, TU Vienna, A-1060 Vienna
Phone: +43-1-58801-15671             FAX: +43-1-58801-15698
Email: blaha at theochem.tuwien.ac.at    WWW: http://info.tuwien.ac.at/theochem/
--------------------------------------------------------------------------




More information about the Wien mailing list