]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make test more reliable by moving the temporary files into the ncpu_*
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Aug 2011 16:34:19 +0000 (16:34 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Aug 2011 16:34:19 +0000 (16:34 +0000)
directory. This way the test can be run at the same time for different
cpu counts.

git-svn-id: https://svn.dealii.org/trunk@24201 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/no_flux_constraints_02.cc
tests/mpi/no_flux_constraints_02/ncpu_1/cmp/generic
tests/mpi/no_flux_constraints_02/ncpu_9/cmp/generic

index 219d903588dc43474f3545c4fa944c96e37d0f53..5001a20aebab59071bdf6990d77dd76812eedeb0 100644 (file)
@@ -120,15 +120,16 @@ void test()
                                                   MappingQ<dim>(degree));*/
   constraints.close();
 
+  std::string base = output_file_for_mpi("no_flux_constraints_02");
+  
   if (myid==0)
-       system("rm -rf no_flux_constraints_02/cm_?.dot");
+       system(("rm -rf " + base + "cm_?.dot").c_str());
 
   MPI_Barrier(MPI_COMM_WORLD);
 
   { //write the constraintmatrix to a file on each cpu
-       char fname[] = "no_flux_constraints_02/cm_0.dot";
-       fname[26]+=myid;
-       std::ofstream file(fname);
+       std::string fname = base+"cm_" + Utilities::int_to_string(myid) + ".dot";
+       std::ofstream file(fname.c_str());
        constraints.print(file);
   }
   MPI_Barrier(MPI_COMM_WORLD);
@@ -137,10 +138,10 @@ void test()
   {
        //sort and merge the constraint matrices on proc 0, generate a checksum
        //and output that into the deallog
-       system("cat no_flux_constraints_02/cm_?.dot|sort -n|uniq >no_flux_constraints_02/cm");
-       system("md5sum no_flux_constraints_02/cm >no_flux_constraints_02/cm.check");
+       system((std::string("cat ") + base+"cm_?.dot|sort -n|uniq >" + base+"cm").c_str());
+       system((std::string("md5sum ") + base + "cm >" + base + "cm.check").c_str());
        {
-         std::ifstream file("no_flux_constraints_02/cm.check");
+         std::ifstream file((base+"cm.check").c_str());
          std::string str;
          while (!file.eof())
          {
index 771f7b978f1ddc68e778274ea41553701d1bc131..b8aedf6cb309439eaa6d7777f6665223201ce2f1 100644 (file)
@@ -2,7 +2,7 @@
 DEAL:0:3d::# flagged cells = 224
 DEAL:0:3d::#cells = 7712
 DEAL:0:3d::#dofs = 27018
-DEAL:0:3d::8d31dbb7fcfab0b5578ba30b9d2e982c  no_flux_constraints_02/cm
+DEAL:0:3d::8d31dbb7fcfab0b5578ba30b9d2e982c  no_flux_constraints_02/ncpu_1/outputcm
 DEAL:0:3d::
 DEAL:0:3d::#constraints on 0: 2088
 DEAL:0:3d::OK
index a9c78f0d1c55f7c9efa8811cea401a7fa64322de..d7107b9f5b4c18ad1df1d4104fa43fb53ed4c579 100644 (file)
@@ -2,7 +2,7 @@
 DEAL:0:3d::# flagged cells = 224
 DEAL:0:3d::#cells = 7712
 DEAL:0:3d::#dofs = 27018
-DEAL:0:3d::8d31dbb7fcfab0b5578ba30b9d2e982c  no_flux_constraints_02/cm
+DEAL:0:3d::8d31dbb7fcfab0b5578ba30b9d2e982c  no_flux_constraints_02/ncpu_9/outputcm
 DEAL:0:3d::
 DEAL:0:3d::#constraints on 0: 39
 DEAL:0:3d::#constraints on 1: 771

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.