Using PLUMED to compute committor with LAMMPS #1516
…if it needs to. This would be needed if you were computing committors for example
This is a small change to the interface between LAMMPS and PLUMED. This change has been made to address a feature that was asked for by a user. I am not sure that this is the correct way to do things on the LAMMPS side or even if this is a sensible way to implement the particular method that the user asked for.
Essentially the feature added here allows PLUMED to stop the LAMMPS calculation when some condition is satisfied. This would be useful if you were calculating a committor or something similar. The way that this is implemented is that LAMMPS passes PLUMED an integer that has a value of 0. If PLUMED wants to stop LAMMPS then it sets this integer equal to 1. LAMMPS then checks the value of the int and if it is not zero it throws an error and thus stops the calculation.
I throw an error as I wasn't sure what method to use to stop the calculation otherwise. My worry is that the user might, for instance, have multiple run cycles in the single lammps input and want these additional runs to execute once the first one finishes and arrives at the point when PLUMED tells it to stop. Alternatively, there might be some analysis of the output after the stop point, which wouldn't be executed because the error was thrown. At the same time though it may be that the error is the right thing to throw as the user could perhaps have things after the run command that require the full number of steps that was asked for.
I would appreciate some advice on what you think is the correct way to do this or if doing this sort of calculation even makes sense at all. Thanks in advance.
This does not address a GitHub issue
Gareth Tribello, Queen's University Belfast
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
This does not affect backwards compatibility.
I ran the tests on the interface that I developed and placed on Travis-ci locally when I built the interface between PLUMED and lammps and they still all give the same results. I also checked that PLUMED can indeed stop lammps.
Post Submission Checklist
Please check the fields below as they are completed after the pull request has been submitted. Delete lines that don't apply
Further Information, Files, and Links
No changes were made to the documentation because the way these features would be used is documented on the PLUMED website.
@gtribello a better and cleaner way to do what you are trying to do is to use the "timeout" feature in the Timer class. This can be used to set a wall time limited to have a minimization or run stop if the time runs out, but you can also call
This was implemented with the intent to stop LAMMPS runs prematurely in an orderly fashion. It will simply act as if the number of steps for a run had been chosen smaller than the actual number of steps.