Clear command trigger a segmentation fault

Dear lammps-users,

I want to calculate the density of methane under 1-50MPa,333K, using fix_gcmc. And I try to use the command ‘label’+‘jump’+‘next’+‘clear’ to write a loop input script as shown in ‘in.rho’ attached. But when I use the ‘clear’ command to clear the setting and atoms in previous pressure, the error segmentation fault is triggered as shown in 1.out attached. So, anyone could give me some suugestions? Thanks in advance.

Best regard

Dongbo Wang

in.rho (2.18 KB)

1.out (3.37 KB)

Dear lammps-users,

I want to calculate the density of methane under 1-50MPa,333K, using fix_gcmc. And I try to use the command ‘label’+‘jump’+‘next’+‘clear’ to write a loop input script as shown in ‘in.rho’ attached. But when I use the ‘clear’ command to clear the setting and atoms in previous pressure, the error segmentation fault is triggered as shown in 1.out attached. So, anyone could give me some suugestions? Thanks in advance.

please apply the following two small changes to the source, recompile, try again and let us know, if that solves your problem.

axel.

$ git diff …/src/atom*.cpp
diff --git a/src/atom.cpp b/src/atom.cpp
index 24ad2d40d…de5d30930 100644
— a/src/atom.cpp
+++ b/src/atom.cpp
@@ -211,7 +211,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
tag_enable = 1;
map_style = map_user = 0;
map_tag_max = -1;

  • map_maxarray = map_nhash = -1;
  • map_maxarray = map_nhash = map_nbucket = -1;

max_same = 0;
sametag = NULL;
diff --git a/src/atom_map.cpp b/src/atom_map.cpp
index 7949e327a…c23aeec83 100644
— a/src/atom_map.cpp
+++ b/src/atom_map.cpp
@@ -335,7 +335,7 @@ void Atom::map_delete()
map_bucket = NULL;
map_hash = NULL;
}

  • map_nhash = 0;
  • map_nhash = map_nbucket = 0;
    }
    }