Hi,
I have written a code that uses LAMMPS as a library. I am having issues with lost atoms when I use more than 12 cores. If I take the initial configuration and run LAMMPS normally on 40 cores, I don’t find any issues. The relevant part of my code is:
for(int step=0; step<K+1; step++)
{
array_to_vector(step, pos_current_array, pos_vector, 3N, 1.0);
array_to_vector(step, vel_current_array, vel_vector, 3N, 1.0);
boxlo[0] = volume_current_array[step][0];
boxhi[0] = volume_current_array[step][1];
boxlo[1] = volume_current_array[step][2];
boxhi[1] = volume_current_array[step][3];
boxlo[2] = volume_current_array[step][4];
boxhi[2] = volume_current_array[step][5];
lammps_reset_box(lmp, boxlo, boxhi, 0.0, 0.0, 0.0);
lammps_scatter_atoms(lmp,const_cast<char *>(“x”),1,3,pos_vector);
lammps_scatter_atoms(lmp,const_cast<char *>(“v”),1,3,vel_vector);
lmp->input->one(const_cast<char *>(“run 0 post no”));
…
}
And the error I’m getting from LAMMPS is:
thermo_style custom step temp pe ke enthalpy press xlo xhi ylo yhi zlo zhi
2 by 4 by 4 MPI processor grid
run 0 post no
Neighbor list info …
update every 1 steps, delay 1 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 5.3065
ghost atom cutoff = 5.3065
binsize = 2.65325, bins = 19 19 19
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair sw, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.724 | 2.737 | 2.856 Mbytes
Step Temp PotEng KinEng Enthalpy Press Xlo Xhi Ylo Yhi Zlo Zhi
ERROR: Lost atoms: original 4000 current 2253 (…/thermo.cpp:433)
Last command: run 0 post no
I should mention that I’m scattering/gathering atoms from a NPT simulation. I initially read in a data file with the atom id’s consecutively ordered, and I’m defining atom_modify map array before reading in this data file.
I’m grateful for any help.
Steve