I have a problem with the Intel Fortran compilers giving different performance at one point of my program depending on the version of the compiler used. With the version composer_xe_2011_sp1.9.293, I get a hot spot (It spends 20s) at this line:
pw = theCellState%pw(vk)
where theCellState is an object, pw a method on that object (which is pure), and whose code is:
pure function pw(this,i)
class(cellStateArray), intent(in) :: this
integer, intent(in) :: i
real(fp) :: pw
pw = this%pw_(i)
end function pw
where this%pw_ is an array, member of the object.
If you look at the assembly code (generated by composer_xe_2011_sp1.9.293) for this line, I get:
mov %rdx, %rsi
movq %r8, 0x3463b6(%rip)
movq %rdi, 0x3463b7(%rip)
and more than 100 lines or movq !
If I compile the program with composer_xe_2011_sp1.7.256 or composer_xe_2011_sp1.6.233, the time spent at this line comes back to 0.036s, and the assembly code is just
movq 0x3a0(%rsi), %r15
shl $0x3, %r15
addq 0x360(%rsi), %r15
movq %r12, 0x68(%rsp)
Do you have any idea where the problem comes from ?