Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using PLUMED to compute committor with LAMMPS #1516

Merged
merged 2 commits into from Jun 17, 2019

Conversation

Projects
None yet
3 participants
@gtribello
Copy link
Contributor

commented Jun 16, 2019

…if it needs to. This would be needed if you were computing committors for example

Summary

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.

Related Issues

This does not address a GitHub issue

Author(s)

Gareth Tribello, Queen's University Belfast

Licensing

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).

Backward Compatibility

This does not affect backwards compatibility.

Implementation Notes

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

  • The feature or features in this pull request is complete
  • Licensing information is complete
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • Suitable new documentation files and/or updates to the existing docs are included
  • The added/updated documentation is integrated and tested with the documentation build system
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system
  • A package specific README file has been included or updated
  • One or more example input decks are included

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.

Added call to PLUMED with setStopFlag so that PLUMED can stop LAMMPS …
…if it needs to. This would be needed if you were computing committors for example
@akohlmey

This comment has been minimized.

Copy link
Member

commented Jun 16, 2019

@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 timer->force_timeout() to have the run stop at the next iteration. This has the benefit, that it doesn't cause an error, it just stops the run. thus once can for example continue a calculation with different settings after a certain condition is reached, which sounds very much like what you are talking about.

@akohlmey akohlmey self-assigned this Jun 16, 2019

@akohlmey akohlmey added this to the Stable Release Summer 2019 milestone Jun 16, 2019

@akohlmey akohlmey added the update label Jun 16, 2019

@gtribello

This comment has been minimized.

Copy link
Contributor Author

commented Jun 16, 2019

Thanks @akohlmey. That is exactly what was needed. Are there any side effects that stopping the lammps calculation early might have that we should try to avoid or do you think it is OK to do this?

@akohlmey akohlmey requested review from sjplimp, stanmoore1, rbberger and athomps Jun 17, 2019

@akohlmey

This comment has been minimized.

Copy link
Member

commented Jun 17, 2019

Thanks @akohlmey. That is exactly what was needed. Are there any side effects that stopping the lammps calculation early might have that we should try to avoid or do you think it is OK to do this?

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.

@sjplimp
Copy link
Contributor

left a comment

yes, Axel's method to stop LAMMPS is better

@gtribello

This comment has been minimized.

Copy link
Contributor Author

commented Jun 17, 2019

OK guys. That is great. Thanks, as always, for the help.

@akohlmey akohlmey merged commit 1452d3d into lammps:master Jun 17, 2019

6 checks passed

lammps/pull-requests/build-docs-pr head run ended
Details
lammps/pull-requests/cmake/cmake-serial-pr head run ended
Details
lammps/pull-requests/kokkos-omp-pr head run ended
Details
lammps/pull-requests/openmpi-pr head run ended
Details
lammps/pull-requests/serial-pr head run ended
Details
lammps/pull-requests/shlib-pr head run ended
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.