issue regarding parallel lammps

Hello everyone,

I have been working on PDLAMMPS to store some state variable (e.g. bond extension) throughout the runs. PDLAMMPS already stores r0 (initial bond length). I am trying to initialize and store r1 in a same manner (Fix_peri_neigh.cpp) and update in function: compute (int efla, int vflag) in pair_peri_lps.cpp. The code runs fine on a single processor. But on multiple processors (lammps compiled with MPICH2 on OSX 10.8.2) lammps either crashes or gets stuck. The memory_usage(), grow_arrays(), copy_arrays(), pack_exchange() and unpack_exchange() was also updated by adding r1. I tried to debug in the Fix_peri_neigh.cpp. During debugging it seems like the code gets stuck at copy_arrays(), pack/unpack_exchange(). I believe there may be some indexing issue that I’m missing (e.g. buff[m++]) but was not able to figure out what exactly it is that causing this problem. Some hint will be really helpful in this case. The Fix_peri_neigh.cpp, pair_peri_lps.cpp and the PDLAMMPS input file is attached.

Thanks in advance.


fix_peri_neigh.cpp (15 KB)

fix_peri_neigh.h (2.32 KB)

pair_peri_lps.cpp (22.4 KB)

pair_peri_lps.h (2.74 KB)

in.PD_cylinderElastic (1.07 KB)

I think the issue is in pack_exchange() where
buf[0] = m/2 needs to become m/3. Buf[0] is
the number of neighs. Also the 2 size_restart
methods need to return different values, b/c
you are adding to the size of the restart info.

More generally, if you want this new option
to be in the LAMMPS distro, you can’t code
it as a one-way change to fix peri neigh. The
code has to still be able to do what it did
before w/out the option to store r1.