[MOAB-dev] commit/MOAB: tautges: Some error checking and cleaning up of output, and allowing input of arbitrary grid size.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Sep 6 14:21:37 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/487a2accde0a/
Changeset:   487a2accde0a
Branch:      master
User:        tautges
Date:        2013-09-06 21:21:23
Summary:     Some error checking and cleaning up of output, and allowing input of arbitrary grid size.

Affected #:  2 files

diff --git a/src/moab/ScdInterface.hpp b/src/moab/ScdInterface.hpp
index 33e75e2..31609f2 100644
--- a/src/moab/ScdInterface.hpp
+++ b/src/moab/ScdInterface.hpp
@@ -1138,7 +1138,8 @@ inline ErrorCode ScdInterface::compute_partition_sqijk(int np, int nr,
       }
     }
   }
-  if (perfa_best == -1 || perfb_best == -1) return MB_FAILURE;
+  if (perfa_best == -1 || perfb_best == -1) 
+    return MB_FAILURE;
 
     // VARIABLES DESCRIBING THE MESH:
     // pijk[i] = # procs in direction i

diff --git a/test/parallel/structured3.cpp b/test/parallel/structured3.cpp
index 5a059fe..f06b382 100644
--- a/test/parallel/structured3.cpp
+++ b/test/parallel/structured3.cpp
@@ -11,7 +11,7 @@
 using namespace moab;
  
   // Number of cells in each direction:
-const int NC = 2;
+int NC = 4;
 const int ITERS = 50;
  
 void create_parallel_mesh();
@@ -19,6 +19,9 @@ void create_parallel_mesh();
 int main(int argc, char *argv[]) 
 {
   MPI_Init(&argc, &argv);
+
+  if (argc > 1) NC = atoi(argv[1]);
+  
   int err = RUN_TEST(create_parallel_mesh);
  
   MPI_Finalize();
@@ -40,7 +43,11 @@ void create_parallel_mesh()
   par_data.pComm = &pc;
   par_data.gDims[0] = par_data.gDims[1] = par_data.gDims[2] = 0;
   par_data.gDims[3] = par_data.gDims[4] = par_data.gDims[5] = NC;
-  par_data.gDims[5] = 1;
+  if ((par_data.gDims[3]-par_data.gDims[0])*(par_data.gDims[3]-par_data.gDims[0])*(par_data.gDims[3]-par_data.gDims[0]) < (int)pc.size()) {
+    std::cerr << "Too few processors for this number of elements." << std::endl;
+    CHECK_ERR(MB_FAILURE);
+  }
+    
   par_data.partMethod = ScdParData::SQIJK;
   rval = scdi->construct_box(HomCoord(), HomCoord(), NULL, 0, // no vertex positions
                              new_box, NULL, // not locally periodic
@@ -69,11 +76,11 @@ void create_parallel_mesh()
   CHECK_ERR(rval);
 
   Range empty_range;
-  std::cout << "Exchanging tags: ";
+  if (!pc.rank()) std::cout << "Exchanging tags: ";
   for(int i = 0; i < ITERS; i++) {
-    std::cout << i << ";";
+    if (!pc.rank()) std::cout << i << ";";
     pc.exchange_tags(tag, empty_range);
     CHECK_ERR(rval);
   }
-  std::cout << std::endl;
+  if (!pc.rank()) std::cout << std::endl;
 }

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list