I have a very simple problem, I’m trying to accelerate the following loop using OpenAcc.
IB(1) = 1 IBB(1) = 1 DO 5 I =2,IMM1 IB(I) = 1 + (I-1)/NSBLOCK NLEFT = IMM1 - (IB(I)-1)*NSBLOCK IF(NLEFT.LT.NSMID) IB(I) = IB(I-1) IBB(I) = 1 + (I-1)/NBBLOCK NLEFT = IMM1 - (IBB(I)-1)*NBBLOCK IF(NLEFT.LT.NBMID) IBB(I) = IBB(I-1) 5 CONTINUE
When I try to compile using OpenAcc, I get the following messages:
Loop carried dependence of ‘ib’ prevents parallelization
Loop carried backward dependence of ‘ib’ prevents vectorization
Loop carried dependence of ‘ibb’ prevents parallelization
Loop carried scalar dependence for ‘nleft’ at line 4622
Loop carried backward dependence of ‘ibb’ prevents vectorization
I’ve tried splitting the loop into as per the directions in this article (http://www.pgroup.com/lit/articles/insider/v1n2a1.htm), but I’m still having trouble with getting this loop offloaded to the accelerator.
Any pointers as to a work-around would be much appreciated. Apologies if I’ve missed something obvious, but this is all rather new to me!