biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes potential bug in neighborsearching.
[alexxy/gromacs.git]
/
src
/
gromacs
/
mdlib
/
ns.c
diff --git
a/src/gromacs/mdlib/ns.c
b/src/gromacs/mdlib/ns.c
index 496f605300962ce27da0b3a89047a353ffdd4de3..430e26d304780b5b3f828efdad076163127cff1d 100644
(file)
--- a/
src/gromacs/mdlib/ns.c
+++ b/
src/gromacs/mdlib/ns.c
@@
-430,6
+430,14
@@
static gmx_inline void close_i_nblist(t_nblist *nlist)
nlist->jindex[nri+1] = nlist->nrj;
len = nlist->nrj - nlist->jindex[nri];
nlist->jindex[nri+1] = nlist->nrj;
len = nlist->nrj - nlist->jindex[nri];
+ /* If there are no j-particles we have to reduce the
+ * number of i-particles again, to prevent errors in the
+ * kernel functions.
+ */
+ if ((len == 0) && (nlist->nri > 0))
+ {
+ nlist->nri--;
+ }
}
}
}
}