Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28457 Discussions

low performance caused by dynamically allocated memory

finback
Beginner
293 Views

a lot of dynamically allocated memory is used in my code. The code generated by Compaq Visual Fortran runs good. But when I use Intel Fortran Compiler for Linux to compile it, the performance drops terribly. I used gprof to dig out that this problem is related to several subroutines in which the dynamic memory is intensively used as well as pointers. But I don't know how to solve this problem. Does anybody have any experience or idea about this issue?

one of the subroutines mentioned about is give here. In the following code, the array elements of taLvl(level) are all dynamic memory.

Any suggestion or comments would be appreciated.



subroutine collect(level)
integer, intent(in):: level

integer iL,iGrpNum
complex cK,cEta
complex, dimension(:,:), pointer:: caCtrb2OutE, caCtrb2OutH
complex, dimension(:,:), pointer:: caCtrb2SonE, caCtrb2SonH
complex, dimension(:), pointer:: alpha
type(grp), dimension(:), pointer:: taGrp

integer g,m,n,iNbr,alphaIdx

iGrpNum=taLvl(level)%iGrpNum
iL=taLvl(level)%iL
cK=taLvl(level)%cK
cEta=taLvl(level)%cEta
taGrp=>taLvl(level)%taGrp


do g=1, iGrpNum

caCtrb2SonE=>taGrp(g)%caCtrb2SonE
caCtrb2SonH=>taGrp(g)%caCtrb2SonH

caCtrb2SonE=zero
caCtrb2SonH=zero

do n=1, taGrp(g)%iNbrNum

iNbr=taGrp(g)%iaNbr(n)
caCtrb2OutE=>taGrp(iNbr)%caCtrb2OutE
caCtrb2OutH=>taGrp(iNbr)%caCtrb2OutH

alphaIdx=taGrp(g)%iaAlphaIdx(n)
alpha=>taLvl(level)%caAlpha(:,alphaIdx)

do m=1, 2*iL**2

caCtrb2SonE(:,m) = caCtrb2SonE(:,m) + caCtrb2OutE(:,m)*alpha(m)
caCtrb2SonH(:,m) = caCtrb2SonH(:,m) + caCtrb2OutH(:,m)*alpha(m)

end do
continue

end do

continue

end do

end subroutine collect

0 Kudos
2 Replies
david_a_levinthal
293 Views
which architecture, X86 or Itanium, are you using?
Which build of the Intel compiler?
0 Kudos
finback
Beginner
293 Views
I'm using 7.1 compiler for X86 on a RH9 OS.
0 Kudos
Reply