fix for bug when trying to delete atoms on a node without atoms
This commit is contained in:
@ -161,9 +161,9 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
|
|
||||||
tag_enable = 1;
|
tag_enable = 1;
|
||||||
map_style = map_user = 0;
|
map_style = map_user = 0;
|
||||||
map_tag_max = 0;
|
map_tag_max = -1;
|
||||||
map_maxarray = 0;
|
map_maxarray = 0;
|
||||||
map_nhash = 0;
|
map_nhash = -1;
|
||||||
|
|
||||||
max_same = 0;
|
max_same = 0;
|
||||||
sametag = NULL;
|
sametag = NULL;
|
||||||
@ -1848,9 +1848,9 @@ bigint Atom::memory_usage()
|
|||||||
memory->destroy(memstr);
|
memory->destroy(memstr);
|
||||||
|
|
||||||
bytes += max_same*sizeof(int);
|
bytes += max_same*sizeof(int);
|
||||||
if (map_style == 1)
|
if (map_style == 1 && map_tag_max >= 0)
|
||||||
bytes += memory->usage(map_array,map_maxarray);
|
bytes += memory->usage(map_array,map_maxarray);
|
||||||
else if (map_style == 2) {
|
else if (map_style == 2 && map_nhash >=0) {
|
||||||
bytes += map_nbucket*sizeof(int);
|
bytes += map_nbucket*sizeof(int);
|
||||||
bytes += map_nhash*sizeof(HashElem);
|
bytes += map_nhash*sizeof(HashElem);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -291,7 +291,7 @@ int Atom::map_style_set()
|
|||||||
|
|
||||||
// map_tag_max = max ID of any atom that will be in new map
|
// map_tag_max = max ID of any atom that will be in new map
|
||||||
|
|
||||||
tagint max = 0;
|
tagint max = -1;
|
||||||
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
|
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
|
||||||
MPI_Allreduce(&max,&map_tag_max,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
MPI_Allreduce(&max,&map_tag_max,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user