From: Mark Abraham Date: Mon, 31 Mar 2014 14:28:36 +0000 (+0200) Subject: Fix bug accumulating nrank_pp_intranode on PME ranks X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=0870f68b80707ce34a40ad14d2db1c7535bbfeec;p=alexxy%2Fgromacs.git Fix bug accumulating nrank_pp_intranode on PME ranks The old code led to cr->nrank_pp_intranode=zero on PME ranks, which meant that a command line of mpirun -np 4 mdrun -npme 2 on a two-GPU node would fail, because gmx_select_gpu_ids() runs on all ranks, and it calls limit_num_gpus_used() which thinks 0 PP ranks and 2 GPUs is silly. Adding -gpu_id 01 works, of course, but that takes a different code path in gmx_select_gpu_ids(). Change-Id: Iecd43ef9b71e2cc0339e93724b6b1071f0a159f6 --- diff --git a/src/gromacs/gmxlib/network.c b/src/gromacs/gmxlib/network.c index 06780b90c7..afd3ba6529 100644 --- a/src/gromacs/gmxlib/network.c +++ b/src/gromacs/gmxlib/network.c @@ -426,10 +426,10 @@ void gmx_init_intranode_counters(t_commrec *cr) rank_intranode++; } } - if ((cr->duty & DUTY_PP) && num_pp[i] == mynum) + if (num_pp[i] == mynum) { nrank_pp_intranode++; - if (i < rank_world) + if ((cr->duty & DUTY_PP) && i < rank_world) { rank_pp_intranode++; }