fix segfault for write_data without local bonds/angles/dihedrals/impropers.
This commit is contained in:
@ -390,8 +390,8 @@ void WriteData::bonds()
|
||||
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
|
||||
|
||||
int **buf;
|
||||
if (me == 0) memory->create(buf,maxrow,ncol,"write_data:buf");
|
||||
else memory->create(buf,sendrow,ncol,"write_data:buf");
|
||||
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
|
||||
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
|
||||
|
||||
// pack my bond data into buf
|
||||
|
||||
@ -443,8 +443,8 @@ void WriteData::angles()
|
||||
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
|
||||
|
||||
int **buf;
|
||||
if (me == 0) memory->create(buf,maxrow,ncol,"write_data:buf");
|
||||
else memory->create(buf,sendrow,ncol,"write_data:buf");
|
||||
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
|
||||
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
|
||||
|
||||
// pack my angle data into buf
|
||||
|
||||
@ -514,8 +514,8 @@ void WriteData::dihedrals()
|
||||
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
|
||||
|
||||
int **buf;
|
||||
if (me == 0) memory->create(buf,maxrow,ncol,"write_data:buf");
|
||||
else memory->create(buf,sendrow,ncol,"write_data:buf");
|
||||
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
|
||||
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
|
||||
|
||||
// pack my dihedral data into buf
|
||||
|
||||
@ -585,8 +585,8 @@ void WriteData::impropers()
|
||||
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
|
||||
|
||||
int **buf;
|
||||
if (me == 0) memory->create(buf,maxrow,ncol,"write_data:buf");
|
||||
else memory->create(buf,sendrow,ncol,"write_data:buf");
|
||||
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
|
||||
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
|
||||
|
||||
// pack my improper data into buf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user