mdrun -npme without PME or with PD now generates a fatal error
authorBerk Hess <hess@kth.se>
Tue, 13 Mar 2012 18:10:59 +0000 (19:10 +0100)
committerBerk Hess <hess@kth.se>
Tue, 13 Mar 2012 18:10:59 +0000 (19:10 +0100)
Change-Id: I887f2030e76a2932afd2989e17d7f14acefd18b1

src/kernel/runner.c

index 59a8ea5c3d29abc46ddf9a46818e49414b872c25..af8c9a62c2ecb9f02538788dcdeac4b559812ed5 100644 (file)
@@ -471,6 +471,20 @@ int mdrunner(int nthreads_requested, FILE *fplog,t_commrec *cr,int nfile,
 
     if (!EEL_PME(inputrec->coulombtype) || (Flags & MD_PARTDEC))
     {
+        if (cr->npmenodes > 0)
+        {
+            if (!EEL_PME(inputrec->coulombtype))
+            {
+                gmx_fatal_collective(FARGS,cr,NULL,
+                                     "PME nodes are requested, but the system does not use PME electrostatics");
+            }
+            if (Flags & MD_PARTDEC)
+            {
+                gmx_fatal_collective(FARGS,cr,NULL,
+                                     "PME nodes are requested, but particle decomposition does not support separate PME nodes");
+            }
+        }
+
         cr->npmenodes = 0;
     }