[cig-commits] r1386 - trunk/aspect/source/simulator

heien at dealii.org heien at dealii.org
Tue Nov 27 23:35:57 PST 2012


Author: heien
Date: 2012-11-28 00:35:08 -0700 (Wed, 28 Nov 2012)
New Revision: 1386

Modified:
   trunk/aspect/source/simulator/core.cc
Log:
Fixed parallel parameter write bug

Modified: trunk/aspect/source/simulator/core.cc
===================================================================
--- trunk/aspect/source/simulator/core.cc	2012-11-26 15:29:50 UTC (rev 1385)
+++ trunk/aspect/source/simulator/core.cc	2012-11-28 07:35:08 UTC (rev 1386)
@@ -241,6 +241,8 @@
 
     // finally produce a record of the run-time parameters by writing
     // the currently used values into a file
+    // Only write the parameter files on the root node to avoid file system conflicts
+    if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
     {
       std::ofstream prm_out ((parameters.output_directory + "parameters.prm").c_str());
       AssertThrow (prm_out,
@@ -248,6 +250,7 @@
                                parameters.output_directory + "parameters.prm>."));
       prm.print_parameters(prm_out, ParameterHandler::Text);
     }
+    if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
     {
       std::ofstream prm_out ((parameters.output_directory + "parameters.tex").c_str());
       AssertThrow (prm_out,



More information about the CIG-COMMITS mailing list