Hi,
I am using PGI/18.
Thanks for Mat’s previous support, my OpenACC run all right days ago.
However, when I want to add an if-else segment inside of the OpenACC regime, the dependency relationship become strange and prevent parallelism.
I will try to explain the question simply:
!$acc data
!$acc parallel loop
Do el=1:N
…
A(el)=B(el)+C(el) !it runs in parallel all right
end do
!$acc end data
Now, I add an if-else segment. And here comes the issue:
!$acc data
!$acc parallel loop
Do el=1,N
if (domain(el)==1) then !new added
…
A(el)=B(el)+C(el) !it still runs in parallel all right
else
A(el)=B(el)+C(el) ! same commend, but it says the reuse of A prevent the parallelization
D(el)=D(el)+E(el) ! Here the D also prevents parallelization. But as each thread are with different el, I am sure it should be independent. It seems not suitable for reduction clause here as it is matrix.
end if
end do
!$acc end data
I have two type of problem. Both prevent me for parallelization. Do you have any suggestion about that?
Thanks,
Wending