Slowdown in LAMMPS-GUI for long runs (mostly) cured

Dear LAMMPS-GUI users,

Several of you have reported that LAMMPS-GUI is slowing down substantially for long simulations.
While this issue cannot be completely eliminated, I have identified three main reasons and was about to significantly reduce the impact of one of them.

  1. The choice of the “Data update interval”. This determines how frequently LAMMPS-GUI will try to extract data from the running LAMMPS simulation. The default is every 100 miliseconds. This can be lowered down to 1 milisecond, so LAMMPS-GUI can handle cases where thermo output is very frequent and the simulated system is small (e.g. for tutorial inputs). But lowering this will increase the overhead and slow LAMMPS down. The reason for that is that access to the thermo data is protected by a lock, so that LAMMPS cannot update the data while LAMMPS-GUI is reading it and LAMMPS-GUI cannot read it while LAMMPS is updating it. Creating/deleting and checking for the lock costs time, but also the more frequent LAMMPS-GUI holds the lock, LAMMPS cannot update its thermo data and has to wait. This can be improved by a larger “thermo” interval and a larger data polling interval. This way LAMMPS can keep computing and does not have wait for updating the thermo output. This scenario will result in a higher CPU utilzation.
  2. With a small thermo interval, the data interval must be small as well, since otherwise, LAMMPS can stall, when the buffer for the thermo output is full and it has to wait until LAMMPS-GUI copies it to the output window. A larger thermo interval will reduce the amount of data and thus it takes longer until the buffer is full. According to my research this buffer is 64kB.
    I just found out that LAMMPS-GUI was only using 1k sized buffer for capturing the LAMMPS output (the code was adapted from a stackoverflow post). Increasing it to 64k made the process run much smoother and lowered the overhead. Also,LAMMPS-GUI now monitors the buffer utilization and prints a warning, if it is too high and suggests to increase thermo or decrease the update interval.
  3. The Chart display was by default showing both, the raw data and the smoothed data, which requires processing of all collected data at every chart update interval (by defaullt every 500 milliseconds). In this process, I have identified multiple steps that have undesirable algorithmic complexity and thus slow down a lot for larger data sets. These have been replaced with (much) better scaling alternatives, and the data processing itself has been multi-threaded. Also, the default setting has been changed to only show the “raw” data and thus lower the data processing overhead even further.

I have posted new LAMMPS-GUI test packages, they identify as LAMMPS-GUI version 1.6.15, to LAMMPS Testing Download Repository: . and hope to get some feedback from you. We are very close to the next stable release of LAMMPS and also the tutorials at the LAMMPS workshop in mid-August and I would like to have this behavior improved as much as possible by then.
The changes will also be backported to the 29Aug2024 stable version, which will have one more update with bugfixes before we release a new stable version. There are several other small improvements as well.

Enjoy testing,
Axel.

P.S.: if you encounter any other issue with LAMMPS-GUI, don’t hesitate to let us know. Now, is the best time for it.