Test PME CPU/GPU with walls and box scaling
authorAleksei Iupinov <a.yupinov@gmail.com>
Tue, 16 Jan 2018 15:09:01 +0000 (16:09 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 23 Jan 2018 14:54:44 +0000 (15:54 +0100)
Change-Id: I34f9a1b3a20b25b9cb577f074e08ccddad9f1b2e

src/programs/mdrun/tests/pmetest.cpp
src/programs/mdrun/tests/refdata/PmeTest_ScalesTheBox.xml [new file with mode: 0644]

index 46cfd3c4798bda42b68a1baac06d8fe2fc9eb37d..9057b94f17c3a193f6d38797188487e7ebe2db6c 100644 (file)
@@ -221,6 +221,34 @@ TEST_F(PmeTest, ReproducesEnergies)
     runTest(runModes);
 }
 
+TEST_F(PmeTest, ScalesTheBox)
+{
+    const int         nsteps     = 0;
+    const std::string theMdpFile = formatString("coulombtype     = PME\n"
+                                                "nstcalcenergy   = 1\n"
+                                                "nstenergy       = 1\n"
+                                                "pme-order       = 4\n"
+                                                "pbc             = xy\n"
+                                                "nwall           = 2\n"
+                                                "ewald-geometry  = 3dc\n"
+                                                "wall_atomtype   = OMet CMet\n"
+                                                "wall_density    = 9 9.0\n"
+                                                "wall-ewald-zfac = 5\n"
+                                                "nsteps          = %d\n",
+                                                nsteps
+                                                );
+
+    runner_.useStringAsMdpFile(theMdpFile);
+
+    RunModesList runModes;
+    runModes["PmeOnCpu"]         = {"-pme", "cpu"};
+    //FIXME mixed mode scaling is broken
+    //runModes["PmeOnGpuFftOnCpu"] = {"-pme", "gpu", "-pmefft", "cpu"};
+    runModes["PmeOnGpuFftOnGpu"] = {"-pme", "gpu", "-pmefft", "gpu"};
+
+    runTest(runModes);
+}
+
 }
 }
 }
diff --git a/src/programs/mdrun/tests/refdata/PmeTest_ScalesTheBox.xml b/src/programs/mdrun/tests/refdata/PmeTest_ScalesTheBox.xml
new file mode 100644 (file)
index 0000000..c41bbf1
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Energy Name="Conserved">
+    <Real Name="Time 0.000000 Step 0">47.730976</Real>
+  </Energy>
+  <Energy Name="Reciprocal">
+    <Real Name="Time 0.000000 Step 0">5.717979</Real>
+  </Energy>
+</ReferenceData>