Added lines becoming ineffective for multiple proc. run

Dear Lammps users,

I am trying to add another style in displace_atoms command. So I edited displace_atoms.cpp and added these extra lines:

double **dispvec = atom->dispvec;
double **velvec = atom->velvec;

for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
x[i][0] += dispvec[i][0];
x[i][1] += dispvec[i][1];
x[i][2] += dispvec[i][2];

v[i][0] = velvec[i][0];
v[i][1] = velvec[i][1];
v[i][2] = velvec[i][2];
}
}

This modification becomes effective if only I run lammps with single processor. However, when I use multiple processors, this part of code becoming ineffective.

Any comments on this apparent discrepancy?


Dear Lammps users,

I am trying to add another style in displace_atoms command. So I edited

what "style"?

displace_atoms.cpp and added these extra lines:

    double **dispvec = atom->dispvec;
    double **velvec = atom->velvec;
    for (i = 0; i < nlocal; i++) {
      if (mask[i] & groupbit) {
        x[i][0] += dispvec[i][0];
        x[i][1] += dispvec[i][1];
        x[i][2] += dispvec[i][2];

        v[i][0] = velvec[i][0];
        v[i][1] = velvec[i][1];
        v[i][2] = velvec[i][2];
      }
    }

This modification becomes effective if only I run lammps with single
processor. However, when I use multiple processors, this part of code
becoming ineffective.

Any comments on this apparent discrepancy?

it must be the result of your programming, but likely not at this
location but elsewhere. there is not enough information about what you
are trying to do anyway.

axel.