Hi Istvan,
On 28/2/2011, at 5:55 p.m., istvan.kolossvary.hu wrote:
> Yes, at the top level you call xmin() only once as any function.
> However, the actual XMIN minimizer lives in a function called xminC().
> Both xmin() and xminC() are located in
> amber11/AmberTools/src/sff/xminC.c. The xmin() function is the
> wrapper, which consists of a single infinite loop and calls the
> energy/gradient function whenever xminC(), i.e., the XMIN minimizer
> needs a new gradient. The whole system is classic reverse
> communication and the implementation is the same in NAB and Sander,
> but the wrapper in Sander is a different routine.
Yes.
>
>> that the coordinates are getting broken somehow in sander.
>
> Yes, it looks like it. Maybe checking the coordinates inside XMIN
> could help. At the bottom of the xminC() function (this is identical
> in NAB and Sander) you can dump the xyz_ext[] array to check the
> coordinates at a normal exit from XMIN.
>
> /* Load xyz_ext[]: */
> if ( xyz_min ) {
> for (i=0; i<natm_local; i++) {
> j = atm_indx[i];
> xyz_ext[ 3*j ] = xyz_local[ 3*i ];
> xyz_ext[ 3*j+1] = xyz_local[ 3*i+1];
> xyz_ext[ 3*j+2] = xyz_local[ 3*i+2];
> }
> }
>
> Or a bit further up, inside xminC()'s infinite loop you can dump
> xyz_ext[] every time XMIN returns to ask for a new gradient.
>
> if (status_flag > 0) {
> if ( xyz_min ) {
> for (i=0; i<natm_local; i++) { /* load xyz_ext[] */
> j = atm_indx[i];
> xyz_ext[ 3*j ] = xyz_local[ 3*i ];
> xyz_ext[ 3*j+1] = xyz_local[ 3*i+1];
> xyz_ext[ 3*j+2] = xyz_local[ 3*i+2];
> }
> }
> ...
Thanks, I'll have a play.
But I think I may have stumbled across something relevant. Specifically, if I ask sander for only one cycle of minimisation, I get good coordinates in both "restrt" and "restrt_1". If I ask for two cycles, "restrt_1" (that is, the coordinates after only one step) is broken, and sander exits with this message:
Error opening unit 17: File "restrt_1" exists and may not be overwritten
(I've changed this message in my development version to improve its clarity, so you won't be able to grep for it, but it's what's thrown by amopen() if a file already exists that it's trying to write to.)
So it seems that something is happening after the fact to mess up coordinates. I'll do further investigation.
--
For greater security, I support S/MIME encryption.
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
- application/pkcs7-signature attachment: smime.p7s
Received on Mon Feb 28 2011 - 18:00:04 PST