]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid a race condition by making sure temp files are unique between runs with differe...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 11 Sep 2011 18:13:23 +0000 (18:13 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 11 Sep 2011 18:13:23 +0000 (18:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@24306 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/p4est_2d_constraintmatrix_01.cc
tests/mpi/p4est_2d_constraintmatrix_03.cc
tests/mpi/p4est_3d_constraintmatrix_01.cc
tests/mpi/p4est_3d_constraintmatrix_04.cc

index 8ae11ba1a007270bdf5bb3398a8f87e64cc148e4..fe7136dd720d5ff7b536d2beffc252373d70f44c 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2009, 2010 by the deal.II authors
+//    Copyright (C) 2009, 2010, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -66,7 +66,7 @@ void test()
   DoFTools::make_hanging_node_constraints (dofh, cm2);
 
   {
-    std::ofstream file((std::string("p4est_2d_constraintmatrix_01/dat.") + Utilities::int_to_string(myid)).c_str());
+    std::ofstream file((std::string("p4est_2d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
     file << "**** proc " << myid << std::endl;
     cm.print(file);
     file << "****" << std::endl;
@@ -82,7 +82,7 @@ void test()
     {
       for (unsigned int i=0;i<numproc;++i)
        {
-         cat_file((std::string("p4est_2d_constraintmatrix_01/dat.") + Utilities::int_to_string(i)).c_str());
+         cat_file((std::string("p4est_2d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
        }
 
     }
index 95e6597a42aecfa6e5bced4cd0685cd0138e8483..04dc8d9238e68bbc2909adc96c088d02825f7fc6 100644 (file)
@@ -205,7 +205,7 @@ void test()
 
     if (myid==0)
       {
-       std::ofstream file((std::string("p4est_2d_constraintmatrix_03/dat.") + Utilities::int_to_string(myid)).c_str());
+       std::ofstream file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
        file << "**** proc " << myid << std::endl;
        x_dub.print(file);
       }
@@ -214,7 +214,7 @@ void test()
 
     if (myid==0)
       {
-       cat_file((std::string("p4est_2d_constraintmatrix_03/dat.") + Utilities::int_to_string(0)).c_str());
+       cat_file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(0)).c_str());
       }
 
   tr.set_boundary (0);
index 4ecb625df293c76288fcba53011e4aab8a731f42..b553a89731ff0e2024f72de868558079eb503f86 100644 (file)
@@ -76,7 +76,7 @@ void test()
   DoFTools::make_hanging_node_constraints (dofh, cm2);
 
   {
-    std::ofstream file((std::string("p4est_3d_constraintmatrix_01/dat.") + Utilities::int_to_string(myid)).c_str());
+    std::ofstream file((std::string("p4est_3d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
     file << "**** proc " << myid << std::endl;
     cm.print(file);
     file << "****" << std::endl;
@@ -92,7 +92,7 @@ void test()
     {
       for (unsigned int i=0;i<numproc;++i)
        {
-         cat_file((std::string("p4est_3d_constraintmatrix_01/dat.") + Utilities::int_to_string(i)).c_str());
+         cat_file((std::string("p4est_3d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
        }
 
     }
index d03e903b2a3573c9ff454c93fd6163f89459db6d..3a86a13b91676cc15dff0c65975e4d8b4b01f1ff 100644 (file)
@@ -84,7 +84,7 @@ void test ()
     {
       for (unsigned int i=0;i<numproc;++i)
        {
-         cat_file((std::string("p4est_3d_constraintmatrix_04/dat.") + Utilities::int_to_string(i)).c_str());
+         cat_file((std::string("p4est_3d_constraintmatrix_04/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
        }
     }
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.