reax/c memory problems

I am having problems with lammps and reax/c crashing due to (ostensibly) memory allocation issues. This particular issue seems to have persisted into the August 31 version of lammps which I recently downloaded. I am mainly running using lammps compiled serially (although the problems also exist when using MPI), using the -O3 and -ffast-math optimization flags. I have also tried running with debug information and with no optimization flags (-O0), but receive the same errors. I have attached a file that contains a small system to illustrate the errors I am encountering.

  • By far, the most common error I am encountering is the “ran out of space on far_nbrs: top=X, max=Y” error (where X > Y). In the attached files, running “crash.lmp” by reading in the configuration datafile “crash2.dat” will reproduce this error.
  • I also am receiving a “bondchk failed” error. Running “crash.lmp” by reading in the configuration datafile “crash.dat” will reproduce this error.
  • I have also received a “realloc(): invalid next size” error. Running “crash.lmp” by reading in the configuration datafile “crash3.dat” will reproduce this error.

The various configuration datafiles I have attached were generated from restart files for this small system. That is, crash2.dat was created from the last restart file output by the simulation running from crash.dat, and so on.

These problems do not exist with all configurations and seem to appear randomly, as some of the systems I am attempting to run will be error free. As such it’s been difficult for me to pinpoint a specific issue. Does anyone have any advice on how to deal with these problems?

Thank you very much,

Jason Lai (7.52 KB)

This is something that Metin will have to look into (CCd).
When you do a short, successful run of your system,
are the neighbor counts and other ReaxFF
stats reasonable? Sometimes people manage to
setup a system with far too many neighbors per atom
and this leads to many-body counts within ReaxFF
exploding to large numbers, leading to memory problems.


The neighbour counts do seem reasonable to me in general. For example, if I stage a system with a single ethane molecule, I get a total neighbour count of 28 as I expect. I have noticed, however, that the systems tend to crash when the atoms approach my periodic boundaries. It seems in this case, the neighbour counts increase, and I’m wondering the crashing is caused by, for example, the neighbour counts increasing in a way that reax/c does not anticipate? When restarting a simulation near (or crossing) the boundaries, I get an increased neighbour count of 35 for the same ethane system.




  I had a similar problem and reported that when an oxygen molecule (O-O) crosses the periodic boundary, reax/c crashes and gives a "bondchk failed" error.
Hasan promised to look into the problem and we are waiting for his response. Glad that I am not the only one that caught this bug!


Jason and Suleiman,

Yes, both problems look similar. Thank you both for detailed descriptions and providing data files to reproduce the problems. I am looking into it now.