# Question of compute cluster_atom

Dear all,

I want choice some cluster by lammps command:
compute YYcluster YYgAl cluster/atom 3.0
variable MaxCluster atom “c_YYcluster>=1000”
then I can dump the data as:
dump YYpos3 all custom 10 04.lammpstrj id type x y z v_MaxCluster c_YYcluster
everythin is fine. but when I

There is endless loop.

I add printf() function in compute_cluster_atom.cpp as:
while (1) {

done = 1;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
if (clusterID[i] == clusterID[j]) continue;
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delxdelx + delydely + delz*delz;
if (rsq < cutsq) {
printf("%d %d %lf %lf 1111\n",i,j,clusterID[i],clusterID[j]);
clusterID[i] = clusterID[j] = MIN(clusterID[i],clusterID[j]);
printf("%d %d %lf %lf 2222\n",i,j,clusterID[i],clusterID[j]);
done = 0;
}
}
}
if (!done) change = 1;
if (done) break;
}
then get data as:
1638 4400 1639.000000 2001.000000 1111
1638 4400 1639.000000 1639.000000 2222
1638 4400 1639.000000 2001.000000 1111
1638 4400 1639.000000 1639.000000 2222
1638 4400 1639.000000 2001.000000 1111
1638 4400 1639.000000 1639.000000 2222
the while(1) can not break in compute_cluster_atom.cpp.

I do not know why? can some one help me ? Thanks

02.in (1.61 KB)

AlPb.eam.alloy (83.1 KB)

Normally you will not get much luck asking people to debug your own modifications on the mailing list. In this case it is trivial to see that, because you put done to 0, as long as there are some atoms in range, the loop keeps running forever.

Normally you will not get much luck asking people to debug your own modifications on the mailing list. In this case it is trivial to see that, because you put done to 0, as long as there are some atoms in range, the loop keeps running forever.

​stefan,

this is a real issue and the provided input can reproduce the stall with an unmodified LAMMPS.

axel.​

Oh, oops. I thought the “done” was added as a modification. My apologies.