[gmx-developers] cmap_setup_grid_index bug?

Per Larsson larsson.r.per at gmail.com
Tue Oct 28 08:43:39 CET 2014


Hi David

I'm still around, but expert would be to stretch things maybe :-)

Email me off list if you have anymore information and I will take a look. Since I'm currently on parental leave there is a bit of lag before things get done though...

Cheers
/Per

Skickat från min iPhone

> 28 okt 2014 kl. 08:29 skrev David van der Spoel <spoel at xray.bmc.uu.se>:
> 
>> On 2014-10-24 13:50, David van der Spoel wrote:
>> In listed-forces/bonded.cpp I found the following function (when
>> debugging a SEGV in cmap_dihs), note the comment was already there. It
>> seems that the grid_spacing is used in a strange way, with data from 1
>> until grid_spacing - 2, is that correct?
>> 
>> /*! \brief Mysterious undocumented function */
>> static int
>> cmap_setup_grid_index(int ip, int grid_spacing, int *ipm1, int *ipp1,
>> int *ipp2)
>> {
>>     int im1, ip1, ip2;
>> 
>>     if (ip < 0)
>>     {
>>         ip = ip + grid_spacing - 1;
>>     }
>>     else if (ip > grid_spacing)
>>     {
>>         ip = ip - grid_spacing - 1;
>>     }
>> 
>> If that is correct, then code like
>>         pos1    = iphi1*cmap_grid->grid_spacing+iphi2;
>> 
>> is suspect. The SEGV finally comes in this statement:
>>        ty[0]   = cmapd[pos1*4];
>> 
>> But topology/idef.h seems to tell me that the array should be indexed
>> from 0 to grid_spacing-1
>> typedef struct
>> {
>>     real *cmap; /* Has length 4*grid_spacing*grid_spacing, */
>>     /* there are 4 entries for each cmap type (V,dVdx,dVdy,d2dVdxdy) */
>> } gmx_cmapdata_t;
>> 
>> In summary, cmap_setup_grid_index seems very suspicious.
>> 
>> Any deeper insights anyone?
> 
> Do we have any CMAP experts still?
> 
> 
> -- 
> David van der Spoel, Ph.D., Professor of Biology
> Dept. of Cell & Molec. Biol., Uppsala University.
> Box 596, 75124 Uppsala, Sweden. Phone:    +46184714205.
> spoel at xray.bmc.uu.se    http://folding.bmc.uu.se
> -- 
> Gromacs Developers mailing list
> 
> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!
> 
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> 
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org.


More information about the gromacs.org_gmx-developers mailing list