Bug #625

Range error on a single core run in pme.c (Gromacs 4.5.3)

Added by Jia Liu almost 10 years ago. Updated almost 10 years ago.

Erik Lindahl
Target version:
Affected version - extra info:
Affected version:


Created an attachment (id=580)
The input mdp file

Dear Developers.

We are using version 4.5.3 to simulate a polymer under pbc conditions. The polymer is embedded in a triclinic unit cell with lattice vectors a >> b, c. These lattice vectors also satisfy the box conditions given in page 12 of the manual. We could get the system to run using multiple cores, but not using a single core. Attempts to run the system on a single core resulted in a segmentation fault. In the debug mode, it shows the following:

Program mdrun, VERSION 4.5.3
Source code file: pme.c, line: 300

Range checking error:
Variable idxptr[ZZ] has value 817. It should have been within [ 0 .. 43 ]

We traced the problem to memory allocation in the script pme.c:

static void
make_gridindex5_to_localindex(int n,int local_start,int local_range,
int **global_to_local,
real **fraction_shift) {
for(i=0; (i<5*n); i++)
//. . .

When we changed the scaling factor "5" to a higher number of "10," we were able to get the code to run on a single core. Could you please confirm if such a change is ok, and that no other corresponding changes to the code are required? Also, why is the scaling factor chosen to be "5," and not any other integer?

We are concerned because similar changes to version 4.0.5 do not work and the system could not be run on a single core.

Best regards,
Jia Liu
Applications Engineer

test.mdp (1.14 KB) test.mdp The input mdp file Jia Liu, 12/23/2010 01:34 AM


#1 Updated by Erik Lindahl almost 10 years ago

No, that is not a bug. The factor 5 is basically chosen to account for offsets up to 2 in each direction, i.e. the central cell, a margin for the skew factor of triclinic cells, and then molecules potentially sticking out a bit.

PBCs are calculated slightly differently in parallel. Do you have a periodic molecule? In that case, have you enabled the separate mdp option for that?

#2 Updated by Jia Liu almost 10 years ago

Thanks a lot for your quick response.

Yes, adding the extra mdp option solved the problem. We didn't realize the difference in pbc calculation between serial and parallel runs.

Jia Liu

Also available in: Atom PDF