X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fmdlib%2Fns.c;h=430e26d304780b5b3f828efdad076163127cff1d;hb=3acec9446e43553cb549e0775a5f4e235c7b783c;hp=496f605300962ce27da0b3a89047a353ffdd4de3;hpb=79cdf779e78f4f4c0c8573dc686004b9af94eb33;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/mdlib/ns.c b/src/gromacs/mdlib/ns.c index 496f605300..430e26d304 100644 --- 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]; + /* 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--; + } } }