Move the temporary file MPI workaround into the base mdrun test class
authorAleksei Iupinov <a.yupinov@gmail.com>
Fri, 12 Jan 2018 13:23:41 +0000 (14:23 +0100)
committerAleksei Iupinov <a.yupinov@gmail.com>
Fri, 19 Jan 2018 12:16:35 +0000 (13:16 +0100)
Change-Id: Ic3fb0f42dde408b6f26944ffc59366d21c5086e3

src/programs/mdrun/tests/moduletest.cpp
src/programs/mdrun/tests/pmetest.cpp

index 54f12888c25e2b8b0bba327d545a65286cde39cd..fd5828c7b289cd61aa58262dfa21872f4c60cf32 100644 (file)
@@ -272,6 +272,10 @@ MdrunTestFixture::MdrunTestFixture() : runner_(&fileManager_)
 
 MdrunTestFixture::~MdrunTestFixture()
 {
+#if GMX_LIB_MPI
+    // fileManager_ should only clean up after all the ranks are done.
+    MPI_Barrier(MPI_COMM_WORLD);
+#endif
 }
 
 } // namespace test
index 36b3581a05de792cf0cb3a65070b8580ea456df4..53f65ffab85e89661c1dad02c641b1245ff3e350 100644 (file)
@@ -205,15 +205,6 @@ TEST_F(PmeTest, ReproducesEnergies)
             }
         }
     }
-
-    // This is a workaround for the output files to not be deleted in a parallel run.
-    // TODO: consider moving the barrier into the file manager destructor.
-#if GMX_LIB_MPI
-    if (parallelRun)
-    {
-        MPI_Barrier(MPI_COMM_WORLD);
-    }
-#endif
 }
 
 }