-
Notifications
You must be signed in to change notification settings - Fork 24
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
Cache some charge increment calculations #1126
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1126 +/- ##
==========================================
+ Coverage 93.36% 93.38% +0.01%
==========================================
Files 69 69
Lines 5997 5997
==========================================
+ Hits 5599 5600 +1
+ Misses 398 397 -1 ☔ View full report in Codecov by Sentry. |
Some nice improvements for a couple of systems (GB3 down to ~2 seconds from 12-18) This script should be gobbled up into a solution for #1020 import warnings
warnings.filterwarnings('ignore')
from openff.toolkit import ForceField, Molecule, Topology, Quantity
from IPython import get_ipython
gb3 = Topology.from_pdb("../proteinbenchmark/proteinbenchmark/data/pdbs/gb3-1P7E.pdb")
gb3.box_vectors = Quantity([10, 10, 10], "nanometer")
protein = ForceField('Protein-Specific-0.0.3.offxml').create_interchange(gb3)
caffeine = Molecule.from_smiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C")
caffeine.generate_conformers(n_conformers=1)
caffeine = caffeine.to_topology()
caffeine.box_vectors = Quantity([10, 10, 10], "nanometer")
ligand = ForceField("openff-2.2.1.offxml").create_interchange(caffeine)
print("Exporting ligand system:")
get_ipython().run_line_magic(
"timeit",
"ligand.to_gromacs('tmp')",
)
print("Exporting protein system:")
get_ipython().run_line_magic(
"timeit",
"protein.to_gromacs('tmp')",
)
|
This conflicts a little with #1072, I'm not sure which is preferred |
|
IIRC I was assigned this PR to answer this question, but the wrong thing is linked here and I'm not easily able to find what was supposed to be linked. Could you check this? |
Yep that's the wrong number, I was fishing for #1115 but they don't intersect as obviously as I previously thought |
Using the toolkit's examples as a benchmark was a shifting target because of a major change (openforcefield/openff-toolkit#1981). Re-running the same command the latest commit (6fc864c):
compared on the `main` branch (b623003)
The speedup is relatively minor but I think still worthwhile. Open to feedback |
As long as the macOS jobs continue to come back green, I think this is good to go |
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.
Looks great!
Description
For some systems, most of the time writing GROMACS files was spent adding up a bunch of charges. This is a shortcut to speed that up. Some rough checks using some of the slower toolkit examples:
$ python -m pytest --nbval-lax --dist loadscope -n logical --durations=20 ../openff-toolkit/examples/using_smirnoff_in_amber_or_gromacs ../openff-toolkit/examples/using_smirnoff_with_amber_protein_forcefield -p no:randomly > head.log
With e6f9f88:
Compared to 0.4.0:
Checklist
.to_gromacs
on several systems