-
Notifications
You must be signed in to change notification settings - Fork 67
Major changes to unit cell handling. Fix bugs in GIST, LIE, PairDist actions. Miscellaneous other fixes. #870
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
Conversation
…e it really is used.
@hainm I think I see. The main difference is in how |
@drroe Yeah. |
What are you loading as the |
@drroe You're right again. It's in pytraj's regression test: https://github.com/Amber-MD/pytraj/pull/878/files
I don't think so (there are only several failures in pytraj after I update the code). |
ha, that pdb file is the trouble.
|
OK, I think the issue might be an unnecessary It didn't really do anything before and was innocuous, but the recent improvements to box triggered it. Testing now. |
OK - try now @hainm |
The PGI build in Jenkins failed. |
it's ok now. thanks. |
@drroe another question for that pdb file. The origonal box type is |
This pull request fixes 2 alerts when merging aa80e5b into 1faa9b2 - view on LGTM.com fixed alerts:
|
As long as the cell has all 90 degree angles and all lengths equal this is correct. There are two fundamental changes at work. One is that the unit cell "type" is no longer set once and then fixed. No assumption is made about the cell when parameters are assigned; instead, the "shape" is determined as needed. This allows the box angles to be free parameters (I.e. cpptraj allows the box to change shape during processing as well as orientation). The second change is that more box shapes are recognized (9 total). The old ORTHO (all angles 90 degrees) is covered by the new cubic, tetragonal, and orthorhombic shapes depending on lengths. Does that make sense? |
yeah, thanks. |
@drroe Please try this patch (to master branch; |
@hainm OK, I will try it now. Thanks Hai! |
@hainm patch applied, pytraj installed (python 3.7.9 via anaconda), tests ran (
I will list the warnings below. If the results look good to you we can proceed. I'll have to temporarily disable the "required" status of the Jenkins build in order to merge this. @swails what do you think about making a separate merge gate for pytraj to simplify cases like this, where pytraj is blocking a merge request, but needs to be updated before it is compatible with that merge request? Warnings:
|
yeah, looks good. |
OK - I will for the meantime make Travis the required test so this can get merged. Can change back after. |
The PGI build in Jenkins failed. |
This pull request fixes 2 alerts when merging 226713c into 1faa9b2 - view on LGTM.com fixed alerts:
|
@hainm It's live! Go ahead and update pytraj and I'll test again. |
I will do that tonight. Cheers. |
This merge request is a large rewrite of the way CPPTRAJ handles unit cells, and is the first major version increase in a long time (to version 5.0.0). It started as a way of addressing #860; it does that and much more. Previously, CPPTRAJ was assuming that all unit cell vectors read from trajectory files were X-aligned; i.e., the cell A vector is aligned with the Cartesian X vector, and the B vector is in the XY plane. While this is true for many MD software packages, it is by no means universally true, and part of the problem in #860 is that the symmetric shape matrix was in fact not X-aligned, causing imaging to fail.
This merge request is primarily a rewrite of the Box class to hold in addition to the unit cell 3x lengths and 3x angles the unit cell vectors, the fractional matrix (for converting to fractional coordinates), and the cell volume. All of these are now calculated whenever the Box is assigned to (via a series of new routines depending on the how the cell is originally defined). In the course of this rewrite, I managed to find and fix several bugs, as well as improve the performance of several actions. In general, performance has not suffered too much. Most actions show a small (<2%) or no performance hit, and some actions have improved speed between about 10% and 40% (detailed below).
The biggest effect of this change is that imaging now occurs on a per-frame basis (so things like unit cells that change shape from frame to frame are now properly handled). It also means that coordinate rotation that would previously make imaging impossible (from e.g.
rms
,principa
l, etc) is now handled properly. In other words, rms-fitting before imaging will no longer fail! However, being able to write this out is trajectory-format-dependent since most assume an X-aligned cell. Currently the only formats that support writing "rotated" unit cell vectors are Gromacs XTC and TRR (since they store the unit cell vectors themselves). Also, currently thehelPME
library which handles the reciprocal part of the PME calculation doesn't yet support directly setting unit cell vectors, so PME doesn't support rotated unit cells at this time. @andysim is working on that.Another major change (done initially to support rotated unit cells) is that the COORDS data set has been rewritten so that no data is lost from the Frame class (aside from precision); i.e. values like time, replica indices, etc are no longer lost when converting to COORDS sets.
Bug fixes:
gist
: Fix 'order' calculation for non-orthogonal cells when the energy calculation is run. This issue only affected the CPU code, not the GPU code.lie
: Fix imaging in thelie
action; previously no imaging was done even if unit cell info was present.pairdist
: Fix histogram bins when themaxdist
value is too small; previously the averaging was wrong. Results are now independent ofmaxdist
and number of processes in parallel.General behavior changes:
Speed-ups:
hbond
(both imaging and no imaging),nativecontacts
,radial
(solvent-solute)radial
(solvent-solvent),check
(non-pairlist)pairdist
@hainm This will require changes to pytraj. I'm trying to work on them here (https://github.com/drroe/pytraj/tree/fixshapematrix) but you might be able to do it faster. A lot of the changes in this MR are important fixes, so I'd like to merge this soon.