Fixed exit with FEP with PME nodes without LJ-PME
[alexxy/gromacs.git] / src / gromacs / mdlib / pme_pp.c
index 773ad76f8ea432a1b7ac04c5d874c8df12302654..b375abcef0608beb82b648c13ee94f31e009bb70 100644 (file)
@@ -582,8 +582,10 @@ int gmx_pme_recv_params_coords(struct gmx_pme_pp          *pme_pp,
             /* The box, FE flag and lambda are sent along with the coordinates
              *  */
             copy_mat(cnb.box, box);
-            *bFreeEnergy_q  = (cnb.flags & PP_PME_FEP_Q);
-            *bFreeEnergy_lj = (cnb.flags & PP_PME_FEP_LJ);
+            *bFreeEnergy_q  = ((cnb.flags & GMX_PME_DO_COULOMB) &&
+                               (cnb.flags & PP_PME_FEP_Q));
+            *bFreeEnergy_lj = ((cnb.flags & GMX_PME_DO_LJ) &&
+                               (cnb.flags & PP_PME_FEP_LJ));
             *lambda_q       = cnb.lambda_q;
             *lambda_lj      = cnb.lambda_lj;
             *bEnerVir       = (cnb.flags & PP_PME_ENER_VIR);