bugfix from Trung to avoid problems with read_dump when not all MPI ranks have atoms
This commit is contained in:
@ -710,12 +710,14 @@ void ReadDump::read_atoms()
|
|||||||
while (nsend < nread) {
|
while (nsend < nread) {
|
||||||
lo = MAX(ofirst,rfirst);
|
lo = MAX(ofirst,rfirst);
|
||||||
hi = MIN(olast,rlast);
|
hi = MIN(olast,rlast);
|
||||||
if (otherproc) // send to otherproc or copy to self
|
int numel = (hi-lo)*nfield;
|
||||||
MPI_Send(&buf[nsend][0],(hi-lo)*nfield,MPI_DOUBLE,
|
if (otherproc && numel > 0) { // send to otherproc or copy to self
|
||||||
|
MPI_Send(&buf[nsend][0],numel,MPI_DOUBLE,
|
||||||
otherproc,0,clustercomm);
|
otherproc,0,clustercomm);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
memcpy(&fields[rfirst][0],&buf[nsend][0],
|
memcpy(&fields[rfirst][0],&buf[nsend][0],
|
||||||
(hi-lo)*nfield*sizeof(double));
|
numel*sizeof(double));
|
||||||
nsend += hi-lo;
|
nsend += hi-lo;
|
||||||
if (hi == olast) {
|
if (hi == olast) {
|
||||||
otherproc++;
|
otherproc++;
|
||||||
|
|||||||
Reference in New Issue
Block a user