[MOAB-dev] commit/MOAB: tautges: Fixing various tests that I broke before.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Aug 12 17:01:37 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/55ff37466f3e/
Changeset:   55ff37466f3e
Branch:      master
User:        tautges
Date:        2013-08-13 00:01:28
Summary:     Fixing various tests that I broke before.

NOTE: values in ScdParData::PartitionMethod enumeration have changed.

Affected #:  6 files

diff --git a/src/ScdInterface.cpp b/src/ScdInterface.cpp
index 7c91ab7..1f021ff 100644
--- a/src/ScdInterface.cpp
+++ b/src/ScdInterface.cpp
@@ -20,7 +20,9 @@
         
 namespace moab 
 {
-    
+
+const char *ScdParData::PartitionMethodNames[] = {"alljorkori", "alljkbal", "sqij", "sqjk", "trivial", "nopart"};
+
 ScdInterface::ScdInterface(Core *imp, bool boxes) 
         : mbImpl(imp), 
           searchedBoxes(false),
@@ -323,7 +325,7 @@ ScdBox::ScdBox(ScdInterface *impl, EntityHandle bset,
         : scImpl(impl), boxSet(bset), vertDat(NULL), elemSeq(NULL), startVertex(0), startElem(0)
 {
   for (int i = 0; i < 6; i++) boxDims[i] = 0;
-  for (int i = 0; i < 2; i++) locallyPeriodic[i] = false;
+  for (int i = 0; i < 3; i++) locallyPeriodic[i] = false;
   VertexSequence *vseq = dynamic_cast<VertexSequence *>(seq1);
   if (vseq) vertDat = dynamic_cast<ScdVertexData*>(vseq->data());
   if (vertDat) {
@@ -676,13 +678,6 @@ ErrorCode ScdInterface::tag_shared_vertices(ParallelComm *pcomm, EntityHandle se
 #endif
 }
 
-#ifndef USE_MPI
-ErrorCode ScdInterface::get_neighbor_alljkbal(int , int ,
-                                              const int * const , const int * const , const int * const , 
-                                              int &, int *, int *, int *) 
-{
-  return MB_FAILURE;
-#else
 ErrorCode ScdInterface::get_neighbor_alljkbal(int np, int pfrom,
                                               const int * const gdims, const int * const gperiodic, const int * const dijk, 
                                               int &pto, int *rdims, int *facedims, int *across_bdy)
@@ -780,16 +775,8 @@ ErrorCode ScdInterface::get_neighbor_alljkbal(int np, int pfrom,
   assert(-1 == pto || (facedims[5] <= ldims[5]));
   
   return MB_SUCCESS;
-#endif  
 }
 
-#ifndef USE_MPI
-ErrorCode ScdInterface::get_neighbor_sqij(int , int ,
-                                          const int * const , const int * const , const int * const , 
-                                          int &, int *, int *, int *) 
-{
-  return MB_FAILURE;
-#else
 ErrorCode ScdInterface::get_neighbor_sqij(int np, int pfrom,
                                           const int * const gdims, const int * const gperiodic, const int * const dijk, 
                                           int &pto, int *rdims, int *facedims, int *across_bdy)
@@ -909,16 +896,8 @@ ErrorCode ScdInterface::get_neighbor_sqij(int np, int pfrom,
   assert (-1 == pto || (facedims[2] >= ldims[2] && facedims[5] <= ldims[5]));
 
   return MB_SUCCESS;
-#endif  
 }
 
-#ifndef USE_MPI
-ErrorCode ScdInterface::get_neighbor_sqjk(int , int ,
-                                          const int * const , const int * const , const int * const , 
-                                          int &, int *, int *, int *)
-{
-  return MB_FAILURE;
-#else
 ErrorCode ScdInterface::get_neighbor_sqjk(int np, int pfrom,
                                           const int * const gdims, const int * const gperiodic, const int * const dijk, 
                                           int &pto, int *rdims, int *facedims, int *across_bdy)
@@ -1015,16 +994,8 @@ ErrorCode ScdInterface::get_neighbor_sqjk(int np, int pfrom,
   assert(-1 == pto || (facedims[2] >= ldims[2] && facedims[5] <= ldims[5]));
 
   return MB_SUCCESS;
-#endif  
 }
 
-#ifndef USE_MPI
-ErrorCode ScdInterface::get_neighbor_sqijk(int , int ,
-                                          const int * const , const int * const , const int * const , 
-                                          int &, int *, int *, int *)
-{
-  return MB_FAILURE;
-#else
 ErrorCode ScdInterface::get_neighbor_sqijk(int np, int pfrom,
                                            const int * const gdims, const int * const gperiodic, const int * const dijk, 
                                            int &pto, int *rdims, int *facedims, int *across_bdy)
@@ -1106,16 +1077,8 @@ ErrorCode ScdInterface::get_neighbor_sqijk(int np, int pfrom,
 #endif  
 
   return MB_SUCCESS;
-#endif  
 }
 
-#ifndef USE_MPI
-ErrorCode ScdInterface::get_neighbor_alljorkori(int , int ,
-                                                const int * const , const int * const , const int * const , 
-                                                int &, int *, int *, int *) 
-{
-  return MB_FAILURE;
-#else
 ErrorCode ScdInterface::get_neighbor_alljorkori(int np, int pfrom,
                                                 const int * const gdims, const int * const gperiodic, const int * const dijk, 
                                                 int &pto, int *rdims, int *facedims, int *across_bdy)
@@ -1199,7 +1162,6 @@ ErrorCode ScdInterface::get_neighbor_alljorkori(int np, int pfrom,
   assert(-1 == pto || (facedims[2] >= ldims[2] && facedims[5] <= ldims[5]));
 
   return rval;
-#endif  
 }
   
   //! get shared vertices for alljorkori partition scheme

diff --git a/src/io/NCHelper.hpp b/src/io/NCHelper.hpp
index 83fcec1..4a8f556 100644
--- a/src/io/NCHelper.hpp
+++ b/src/io/NCHelper.hpp
@@ -95,8 +95,8 @@ public:
       lCDims[i] = -1;
     }
 
-    locallyPeriodic[0] = locallyPeriodic[1] = 0;
-    globallyPeriodic[0] = globallyPeriodic[1] = 0;
+    locallyPeriodic[0] = locallyPeriodic[1] = locallyPeriodic[2] = 0;
+    globallyPeriodic[0] = globallyPeriodic[1] = globallyPeriodic[2] = 0;
   }
   virtual ~ScdNCHelper() {}
 
@@ -160,10 +160,10 @@ protected:
   int iCDim, jCDim;
 
   //! Whether mesh is locally periodic in i or j
-  int locallyPeriodic[2];
+  int locallyPeriodic[3];
 
   //! Whether mesh is globally periodic in i or j
-  int globallyPeriodic[2];
+  int globallyPeriodic[3];
 };
 
 //! Child helper class for ucd mesh, e.g. CAM_SE (HOMME) or MPAS

diff --git a/src/io/ReadNC.cpp b/src/io/ReadNC.cpp
index 5c43679..a7903c2 100644
--- a/src/io/ReadNC.cpp
+++ b/src/io/ReadNC.cpp
@@ -19,7 +19,8 @@ ReaderIface* ReadNC::factory(Interface* iface)
 }
 
 ReadNC::ReadNC(Interface* impl) :
-  mbImpl(impl), fileId(-1), mGlobalIdTag(0), mpFileIdTag(NULL), dbgOut(stderr), isParallel(false), partMethod(-1),
+        mbImpl(impl), fileId(-1), mGlobalIdTag(0), mpFileIdTag(NULL), dbgOut(stderr), isParallel(false), 
+        partMethod(ScdParData::ALLJORKORI),
 #ifdef USE_MPI
   myPcomm(NULL),
 #endif
@@ -268,9 +269,8 @@ ErrorCode ReadNC::parse_options(const FileOptions& opts, std::vector<std::string
   const int rank = myPcomm->proc_config().proc_rank();
   dbgOut.set_rank(rank);
 
-  const char* part_options[] = {"alljorkori", "alljkbal", "sqij", "sqjk", "TRIVIAL_PARTITION"};
   int dum;
-  rval = opts.match_option("PARTITION_METHOD", part_options, dum);
+  rval = opts.match_option("PARTITION_METHOD", ScdParData::PartitionMethodNames, dum);
   if (rval == MB_FAILURE) {
     readMeshIface->report_error("Unknown partition method specified.");
     partMethod = ScdParData::ALLJORKORI;

diff --git a/src/moab/ScdInterface.hpp b/src/moab/ScdInterface.hpp
index 9612946..6b61c69 100644
--- a/src/moab/ScdInterface.hpp
+++ b/src/moab/ScdInterface.hpp
@@ -112,7 +112,10 @@ public:
 
     //! Partition method enumeration; these strategies are described in comments for
     //! compute_partition_alljorkori, compute_partition_alljkbal, compute_partition_sqij, and compute_partition_sqjk
-  enum PartitionMethod {NOPART=0, ALLJORKORI, ALLJKBAL, SQIJ, SQJK, SQIJK};
+  enum PartitionMethod {ALLJORKORI=0, ALLJKBAL, SQIJ, SQJK, SQIJK, TRIVIAL, NOPART};
+
+    //! Partition method names
+  static const char *PartitionMethodNames[NOPART];
 
     //! partition method used to partition global parametric space
   int partMethod;

diff --git a/test/scd_test_partn.cpp b/test/scd_test_partn.cpp
index 59a63c5..6bf055c 100644
--- a/test/scd_test_partn.cpp
+++ b/test/scd_test_partn.cpp
@@ -42,10 +42,12 @@ int main(int argc, char**argv)
 {
   if (argc < 2) {
     std::cout << "Usage: " << argv[0] << " <#proc> [<imax> [<jmax><kmax>]]" << std::endl;
-    exit(1);
+    std::cout << "Using default parameters for autotest purposes." << std::endl;
+    np = 4;
+    gdims[0] = gdims[1] = gdims[2] = 0;
+    gdims[3] = gdims[4] = gdims[5] = 100;
   }
-  
-  if (argc < 3) {
+  else if (argc < 3) {
     np = atoi(argv[1]);
     gdims[0] = gdims[1] = gdims[2] = 0;
     gdims[3] = gdims[4] = gdims[5] = 100;

diff --git a/test/scdseq_test.cpp b/test/scdseq_test.cpp
index e5acb0d..e4d5465 100644
--- a/test/scdseq_test.cpp
+++ b/test/scdseq_test.cpp
@@ -1332,23 +1332,28 @@ void test_parallel_partitions()
   
     // alljorkori
     rval = test_parallel_partition(gdims, nprocs, ScdParData::ALLJORKORI);
-    if (MB_SUCCESS != rval) fails++;
+    if (MB_SUCCESS != rval) 
+      fails++;
     
     // alljkbal
     rval = test_parallel_partition(gdims, nprocs, ScdParData::ALLJKBAL);
-    if (MB_SUCCESS != rval) fails++;
+    if (MB_SUCCESS != rval) 
+      fails++;
     
     // sqij
     rval = test_parallel_partition(gdims, nprocs, ScdParData::SQIJ);
-    if (MB_SUCCESS != rval) fails++;
+    if (MB_SUCCESS != rval) 
+      fails++;
     
     // sqjk
     rval = test_parallel_partition(gdims, nprocs, ScdParData::SQJK);
-    if (MB_SUCCESS != rval) fails++;
+    if (MB_SUCCESS != rval) 
+      fails++;
 
       // sqijk
     rval = test_parallel_partition(gdims, nprocs, ScdParData::SQIJK);
-    if (MB_SUCCESS != rval) fails++;
+    if (MB_SUCCESS != rval) 
+      fails++;
   }
 
   if (fails) CHECK_ERR(MB_FAILURE);

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