From 6edd328799f5a3fefdd2a420537de97708953f97 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Mon, 26 Jul 2010 17:55:31 +0200 Subject: [PATCH] fixed PME communication range (no silent errors) --- src/mdlib/domdec.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/mdlib/domdec.c b/src/mdlib/domdec.c index 337196a1fa..603475699e 100644 --- a/src/mdlib/domdec.c +++ b/src/mdlib/domdec.c @@ -164,6 +164,7 @@ const char *edlb_names[edlbNR] = { "auto", "no", "yes" }; typedef struct { int dim; /* The dimension */ + bool dim_match;/* Tells if DD and PME dims match */ int nslab; /* The number of PME slabs in this dimension */ real *slb_dim_f; /* Cell sizes for determining the PME comm. with SLB */ int *pp_min; /* The minimum pp node location, size nslab */ @@ -2695,10 +2696,19 @@ static void init_ddpme(gmx_domdec_t *dd,gmx_ddpme_t *ddpme, int pmeindex,slab,nso,i; ivec xyz; - ddpme->dim = dd->dim[dimind]; + if (dd->comm->npmedecompdim == 1 && dd->dim[0] == YY) + { + ddpme->dim = YY; + } + else + { + ddpme->dim = dimind; + } + ddpme->dim_match = (ddpme->dim == dd->dim[dimind]); + ddpme->nslab = nslab; - if (nslab <= 1) + if (ddpme->nslab <= 1) { return; } @@ -2764,7 +2774,7 @@ static void set_pme_maxshift(gmx_domdec_t *dd,gmx_ddpme_t *ddpme, nc = dd->nc[ddpme->dim]; ns = ddpme->nslab; - if (nc == 1) + if (!ddpme->dim_match) { /* PP decomposition is not along dim: the worst situation */ sh = ns/2; -- 2.11.4.GIT