-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement MD workflows #1672
base: main
Are you sure you want to change the base?
Implement MD workflows #1672
Conversation
Can one of the admins verify this patch? |
@tomdemeyere: Happy to respond to each question but before I do, I just wanted to check that this is the full commit you wanted to share --- just the args/kwargs, right? (In short, I really would love to have MD flows and am willing to work together to figure out how to get this done the best way possible) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1672 +/- ##
==========================================
- Coverage 99.01% 98.99% -0.03%
==========================================
Files 81 83 +2
Lines 3367 3477 +110
==========================================
+ Hits 3334 3442 +108
- Misses 33 35 +2 ☔ View full report in Codecov by Sentry. |
Yes, before doing more I wanted to make sure we are on the same page. I guess my main question here is: how to make these flows common to all codes? Should they call code specific MD jobs? Or, should a calculator be attached to the Atoms object being sent to the MD flow? Once I know this we can work on details |
@tomdemeyere: Good question. Personally, I think what would likely make the most sense is to make a From there, we get to the recipes, and my answer is: "it depends." If it is just a simple If we are talking about a To get started, I would suggest making I should also note that we can always refactor later if there is something we can refactor. No need to prematurely optimize.
If the workflow logic is staying the same regardless of thermostat, then I would suggest one job/workflow where thermostat would be a keyword argument with a sensible default.
See comment above. If we are talking about a
Hard for me to tell from the commit you shared here, but I am not opposed to complexity. In fact, we should not rely on the users to build something complex. If the
This is a good point. However, I think it is solvable. Let's circle back to this when the time is right. |
@Andrew-S-Rosen Thanks for all these details. I will come back to it at some point |
@Andrew-S-Rosen I think this is now a good point to have your input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for kicking this off, @tomdemeyere! Really appreciate the contribution!
This is looking good. I have some comments that are mostly related to some minor restructuring.
Starting with this isolated EMT example is very helpful for me in understanding the process and figuring out what should be refactored, so I thank you for doing that.
src/quacc/recipes/emt/core.py
Outdated
|
||
if temperature: | ||
MaxwellBoltzmannDistribution( | ||
atoms, temperature_K=temperature, **initial_temperature_params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the fixcm
and fixrot
as dedicated keyword arguments, the **kwargs
here can be more clearly described as simply being the **maxwell_boltzmann_distribution_kwargs
. That is a mouthful (although nobody is calling the name directly). Could try something like **maxwell_boltzmann_kwargs
. Either way, the point is that both the docstring and name would be much clearer this way. At a glance, it's not clear what an **initial_temperature_params
is.
I see that your comment is different than the one I received by email from git. But yes, originally my plan was to have these "_base" functions. Either per calculator or in common like you previously said. After discussing that along with other details I was then planning to introduce recipes for the other ensembles (NVT, NPT). Didn't see your comments originally (github mobile) will work on it at some point |
Apologies about the edits! I was trying to sort out where to place them and was going back-and-forth so decided to just save it for a future discussion to avoid confusion. But you got the right idea anyway.
That would be great!
Thank you! |
Few comments:
We are currently working on a Because you said you might be interested in error handling I am leaving that there.
|
The
I agree that a
One could catch the typical
Indeed. This is a limitation of Parsl/Dask, which is really best thought of a task manager. Other true workflow tools like Prefect or Covalent or FireWorks have a separate database for the task metadata and would highlight when/where the job fails. But since Parsl does not have a task database of its own, there is no mechanism to easily store that info. The recommended approach would be to launch your calculations in a
I like that a lot more! |
This should be close to go, there is still something essential before being able to run MD correctly: restarts. They are still difficult to do (impossible in some cases), but that's an ASE problem. I suspect this will take ages to fix; for now I deleted everything related to restart while we wait to see what solutions will get accepted upstream (if any). I looked at automate2, there are indeed some interesting things, like the possibility to specify a temperature/pressure gradient. I will charge back with my idea of "patches" to accomplish that, this would look like: steps = np.arange(1000, 10000, 1)
temperatures = function_of_steps(steps)
my_temp_gradient = TemperatureGradient(steps, temperatures)
my_file_copier = FileCopier(interval = 10)
my_press_gradient = PressureGradient(...)
md_job(... patches = [my_temp_gradient, my_file_copier, my_pressure_gradient]) This is achievable by tuning the generator as you did previously (although it might get packed), for some reason I love this "patching" concept 😅. People could fine-tune their MD, picking what triggers when, Quacc could even have a section in the documentation explaining how to do complex things as we already discussed. Anyway, daydreaming here 🙃 |
Thanks for your persistence with this! I will try to look at this within the next few days (please ping me if I forget). I'm definitely interested to chat more about the patches idea here; perhaps within the context of MD, it could be an interesting proof-of-concept to think about. I'll revisit this when I have the time to give this a proper review! |
Some news on this? Just to know if it is waiting on https://gitlab.com/ase/ase/-/merge_requests/3310 |
Summary of Changes
Closes #1577.
Before going further a little consultation:
MD users use workflows all the time, just for the NVE example in this commit there is pretty much a thousand ways you can run that; doing a first NVT to relax to the desired temperature, or a first NPT to relax to the desired density, etc...
Checklist
main
.black
,isort
, andruff
as described in the style guide.