# acc routine -- create Tesla code but Still :Loop not vectori

Hi,

I have some functions and procedures in my code.

I had placed the acc routine directive before the prototype and the call site also before the function itself, as instructions said.

The Tesla code for functions is generated . However, I still got these messages:

# ucoordinatebc: 215, Loop not vectorized/parallelized: contains call ppcoordinate: 240, Loop not vectorized/parallelized: contains call rcoordinate: 252, Loop not vectorized/parallelized: contains call ccforces: 268, Loop not vectorized/parallelized: contains call ccr: 304, Generating acc routine seq Generating Tesla code ccgradient: 310, Generating acc routine seq Generating Tesla code cctemperature: 316, Generating acc routine seq Generating Tesla code ccscale: 323, Generating acc routine seq Generating Tesla code fixdistance: 334, Generating acc routine seq Generating Tesla code ccboxx: 344, Generating acc routine seq Generating Tesla code \

ccforces routine code.

void ccforces(coordinate *r,coordinate *f, double boxx, double boxy, double boxz, double rcut, double eps0)
{
int myn;
myn=(*r).n;

for (unsigned int i=0; i <myn-1; i++)
for (unsigned int j=i+1; j <myn; j++) {
double dx,dy,dz,sr;
dx=(*r).x_-(*r).x[j];
dy=(*r).y-(r).y[j];
dz=(r).z-(r).z[j];

fixdistance(&dx,boxx);
fixdistance(&dy,boxy);
fixdistance(&dz,boxz);

sr=ccr(dx,dy,dz);
if (sr < rcut)
{
double gr,grx,gry,grz;
grx=gr
dx;
gry=gr
dy;
grz=gr
dz;

(*f).x+=grx;
(*f).y+=gry;
(*f).z+=grz;

(*f).x[j]-=grx;
(*f).y[j]-=gry;
(*f).z[j]-=grz;
}
}
}

For ucoordinatebc function I just call to round function from math.h library.

void ucoordinatebc(coordinate *u, double boxx, double boxy, double boxz)
{
int myn;
double auxx,auxy,auxz,boxxinv,boxyinv,boxzinv;
myn=(u).n;
boxxinv=1.0/boxx;
boxyinv=1.0/boxy;
boxzinv=1.0/boxz;

for (unsigned int i=0; i < myn; i++) {
auxx=(u).x;
auxy=(u).y;
auxz=(u).z;

auxx-=0.5
boxx;
auxy-=0.5
boxy;
auxz-=0.5
boxz;

auxx-=(round(auxx
boxxinv))boxx;
auxy-=(round(auxy
boxyinv))boxy;
auxz-=(round(auxz
boxzinv))*boxz;

(u).x=auxx+0.5boxx;
(u).y[i]=auxy+0.5boxy;
(u).z[i]=auxz+0.5boxz;
}
}

Prototypes, functions implementations and main, are in the same file (for now).

This sequence;

Prototypes
main
functions implementations

Any suggestion?