Skip to content

Commit

Permalink
fix: use all_nlocal instead of nlocal
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudac7 committed Dec 5, 2023
1 parent eefb767 commit a138872
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/lmp/pair_deepmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,16 +785,16 @@ void PairDeepMD::compute(int eflag, int vflag) {
tagint *tag = atom->tag;
int nprocs = comm->nprocs;
// Grow arrays if necessary
if (nlocal > max_nlocal) {
max_nlocal = nlocal;
if (all_nlocal > max_nlocal) {
max_nlocal = all_nlocal;
memory->destroy(stdfsend);
memory->destroy(stdfrecv);
memory->destroy(tagsend);
memory->destroy(tagrecv);
memory->create(stdfsend, nlocal, "deepmd:stdfsendall");
memory->create(stdfrecv, nlocal, "deepmd:stdfrecvall");
memory->create(tagsend, nlocal, "deepmd:tagsendall");
memory->create(tagrecv, nlocal, "deepmd:tagrecvall");
memory->create(stdfsend, all_nlocal, "deepmd:stdfsendall");
memory->create(stdfrecv, all_nlocal, "deepmd:stdfrecvall");
memory->create(tagsend, all_nlocal, "deepmd:tagsendall");
memory->create(tagrecv, all_nlocal, "deepmd:tagrecvall");
}
for (int ii = 0; ii < nlocal; ii++) {
tagsend[ii] = tag[ii];
Expand Down

0 comments on commit a138872

Please sign in to comment.