Re: [AMBER-Developers] XMIN minimisation and coordinates

From: <istvan.kolossvary.hu>
Date: Mon, 28 Feb 2011 23:55:32 +0100

Hi Ben,

>> Yes, I mean a NAB program. A sample program is included in the
>> AmberTools manual. Like in Sander, NAB has a wrapper routine with an
>> infinite loop calling XMIN every time a new gradient has been
>> computed. You can dump the coordinates at that level at every step,
>> even during line minimization.

> I never did find out how this is to be done, since the minimisation
> algorithm seems to be called only once, and returns the final
> coordinates on completion. At least, that's how it appears in the
> NAB script.

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. The last time I
checked XMIN in Sander was just before the Amber 11 release to make
sure that everything is working correctly, ever since I only used
AmberTools.

> 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];
              }
          }
          ...
Best,

    Istvan


_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Mon Feb 28 2011 - 15:00:04 PST
Custom Search