Commit fa6fc947 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

fix issues in FixNeighHistory and FixNeighHistoryOMP reported in...

fix issues in FixNeighHistory and FixNeighHistoryOMP reported in https://sourceforge.net/p/lammps/mailman/message/36138319/

This supersedes and closes PR #734
parent e1189381
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ void FixNeighHistoryOMP::pre_exchange_newton()
#endif
    {
      maxpartner = MAX(m,maxpartner);
      comm->maxexchange_fix = MAX(comm->maxexchange_fix,4*maxpartner+1);
      comm->maxexchange_fix = MAX(comm->maxexchange_fix,(dnum+1)*maxpartner+1);
    }
  }

+8 −8
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ void FixNeighHistory::pre_exchange_newton()

  maxpartner = 0;
  for (i = 0; i < nlocal_neigh; i++) maxpartner = MAX(maxpartner,npartner[i]);
  comm->maxexchange_fix = MAX(comm->maxexchange_fix,4*maxpartner+1);
  comm->maxexchange_fix = MAX(comm->maxexchange_fix,(dnum+1)*maxpartner+1);

  // zero npartner values from previous nlocal_neigh to current nlocal

@@ -720,7 +720,7 @@ int FixNeighHistory::pack_reverse_comm_size(int n, int first)
  last = first + n;

  for (i = first; i < last; i++)
    m += 1 + 4*npartner[i];
    m += 1 + (dnum+1)*npartner[i];

  return m;
}