Breaking a Dependency

My 12.9 linux 64 Centos 6.3 pgcc compiler flags the following loop as having a dependency. I do not see how.

  int Nfreq = (*Env).Nfreq;
  for(i=0;i<Nfreq;i=i+1){
    FRAY[i] = FRAY[i] * BTMRFL;
  }

The only way it could have a dependency is with BTMRFL which may create a dependency. The complete section of code is:

 if( 0.0 < ANGINC && ANGINC < M_PI/2){
    /*BTMRF9( 1, &ANGINC, &BTMRFL, *RRAY, *IBTMbB, Env );*/
    BTMRFL = btmr04(ANGINC, *RRAY, *IBTMbB, Env);
  } else {
    BTMRFL = 0.0;
    /*printf("RFL_BTM: Drop-> R=%f ",*RRAY);
    printf("AB=%f AR=%f AI=%f \n",
	ANGBTM/0.017453293, ANGRAY/0.017453293, ANGINC/0.017453293);*/
  };

  int Nfreq = (*Env).Nfreq;
  for(i=0;i<Nfreq;i=i+1){
    FRAY[i] = FRAY[i] * BTMRFL;
  }

Is this dependency breakable, meaning can I rewrite this code and get the same results, but with no dependency loops to prevent loop parallelization. .

Any help appreciated.

THX 1138

Hi THX 1138,

I don’t see a dependency either so something else is going on. Can you post the -Minfo output and double check that the line number corresponds with this line? Also, what data types are are FRAY and BTMRFL?

  • Mat