crash on read_restart

Hi,

There seems to be a bug in read_restart.cpp. It shows up when one does a simulation of a molecular system with multiple processors and write restart files during the run. For example, using in.melt but with 'atom_style molecular’. If one then re-reads those restart files it will crash:

Program received signal SIGSEGV, Segmentation fault.
LAMMPS_NS::atom::map_clear (this=0xf9f) at …/atom_map.cpp:118
118 sametag[i] = -1;.

The array ‘sametag’ is not yet initialised. It can be resolved by replacing line number 462 in read_restart.cpp,
"
if (atom->map_style) atom->map_init();
"
with
"

if (atom->map_style) {
atom->map_init();
atom->map_set();
}

Thanks,
Bart

Hi,

There seems to be a bug in read_restart.cpp. It shows up when one does a
simulation of a molecular system with multiple processors and write restart
files during the run. For example, using in.melt but with 'atom_style
molecular’. If one then re-reads those restart files it will crash:

sorry. cannot reproduce that one. and valgrind does't flag an error, too.

can you provide the exact/complete test inputs that fail for you?
which version of LAMMPS are you using exactly?

axel.

Hi Axel,

Thank you for your quick response. I forgot to mention that I also disabled the velocity command for the rerun. Attached are the two input files. The version is 1st of Aug 2014.

Thanks,
Bart

in1.melt (612 Bytes)

in2.melt (665 Bytes)

Hi Axel,

Thank you for your quick response. I forgot to mention that I also disabled the velocity command for the rerun. Attached are the two input files. The version is 1st of Aug 2014.

seeing how you do the restart and what i did, it looks the origin of
the problem has to be triggered by the fact that you do a
per-processor restart, while i didn't.

axel.

Hi Axel,

Thank you for your quick response. I forgot to mention that I also disabled the velocity command for the rerun. Attached are the two input files. The version is 1st of Aug 2014.

seeing how you do the restart and what i did, it looks the origin of
the problem has to be triggered by the fact that you do a
per-processor restart, while i didn't.

and looking at the fix that you proposed, it looks like the right
change to do. read_dump and read_data do the same thing.

i'll include it into LAMMPS-ICMS so it won't get lost. steve seems to
be a bit busy these days.

thanks,
   axel.