Hi,
I’m using PGI-Fortran compilers (10.2.0) on Cray XT5 and having trouble vectorizing part of my code. I would appreciate if someone could shed some light on this issue.
I’m invoking the compiler with the following options:
ftn -fast -Minfo -c test.F90
17, Loop not vectorized: data dependency
Loop unrolled 2 times
22, Loop not vectorized: data dependency
Loop unrolled 2 times
AFAIK there are no dependencies between the loop statements and also across iterations. When I encountered a similar issue in a C program, I used the -Msafeptr flag to resolve it, is there something similar for Fortran90?
Thanks in advance.
1 PROGRAM test
2
3 IMPLICIT NONE
4
5 type reaction
6 integer, pointer :: foo(:)
7 real, pointer :: foo1(:)
8 real, pointer :: bar(:)
9 end type reaction
10
11 integer num, i, j, k
12 type(reaction) node
13 real, allocatable :: temp(:)
14
15 allocate(temp(num))
16
17 do i = 1, num
18 k = node%foo(i)
19 node%bar(k) = node%bar(k) + node%foo1(i)
20 enddo
21
22 do i = 1, num
23 node%bar(node%foo(i)) = node%bar(node%foo(i)) + node%foo1(i)
24 enddo
25
26 END PROGRAM test