[MOAB-dev] r4632 - in MOAB/trunk: src/io src/parallel src/parallel/moab test/parallel tools/vtkMOABReader

tautges at mcs.anl.gov tautges at mcs.anl.gov
Wed Mar 23 13:58:18 CDT 2011


Author: tautges
Date: 2011-03-23 13:58:17 -0500 (Wed, 23 Mar 2011)
New Revision: 4632

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
   MOAB/trunk/src/parallel/ParallelMergeMesh.cpp
   MOAB/trunk/src/parallel/moab/ParallelMergeMesh.hpp
   MOAB/trunk/test/parallel/parmerge.cpp
   MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.cxx
Log:
ParallelMergeMesh: updates from Nathan, now it works.

ReadNC: change method used to partition, so it checks available parameters against # procs; 
also partition over I first, then J, then K.

vtkMOABReader: handle tags on vertices differently, as data associated with points instead
of with point cells.



Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2011-03-22 05:39:07 UTC (rev 4631)
+++ MOAB/trunk/src/io/ReadNC.cpp	2011-03-23 18:58:17 UTC (rev 4632)
@@ -646,25 +646,39 @@
   if (isParallel) {
       // partition *the elements* over the parametric space; 1d partition for now, in the k parameter 
       // (or j if there isn't one)
-    if (-1 != klMin) {
-      int dk = (kMax - kMin) / myPcomm->proc_config().proc_size();
-      unsigned int extra = (kMax - kMin) % myPcomm->proc_config().proc_size();
-      klMin = kMin + myPcomm->proc_config().proc_rank()*dk + 
+
+    if (-1 != ilMin && (iMax - iMin) > myPcomm->proc_config().proc_size()) {
+      int di = (iMax - iMin) / myPcomm->proc_config().proc_size();
+      unsigned int extra = (iMax - iMin) % myPcomm->proc_config().proc_size();
+      ilMin = iMin + myPcomm->proc_config().proc_rank()*di + 
           std::min(myPcomm->proc_config().proc_rank(), extra);
-      klMax = klMin + dk + (myPcomm->proc_config().proc_rank() < extra ? 1 : 0);
+      ilMax = ilMin + di + (myPcomm->proc_config().proc_rank() < extra ? 1 : 0);
 
-      ilMin = iMin; ilMax = iMax;
+      klMin = kMin; klMax = kMax;
       jlMin = jMin; jlMax = jMax;
     }
-    else {
+    else if (-1 != jlMin && (jMax - jMin) > myPcomm->proc_config().proc_size()) {
       int dj = (jMax - jMin) / myPcomm->proc_config().proc_size();
       unsigned int extra = (jMax - jMin) % myPcomm->proc_config().proc_size();
       jlMin = jMin + myPcomm->proc_config().proc_rank()*dj + 
           std::min(myPcomm->proc_config().proc_rank(), extra);
       jlMax = jlMin + dj + (myPcomm->proc_config().proc_rank() < extra ? 1 : 0);
 
+      klMin = kMin; klMax = kMax;
       ilMin = iMin; ilMax = iMax;
     }
+    else if (-1 != klMin && (kMax - kMin) > myPcomm->proc_config().proc_size()) {
+      int dk = (kMax - kMin) / myPcomm->proc_config().proc_size();
+      unsigned int extra = (kMax - kMin) % myPcomm->proc_config().proc_size();
+      klMin = kMin + myPcomm->proc_config().proc_rank()*dk + 
+          std::min(myPcomm->proc_config().proc_rank(), extra);
+      klMax = klMin + dk + (myPcomm->proc_config().proc_rank() < extra ? 1 : 0);
+
+      jlMin = jMin; jlMax = jMax;
+      ilMin = iMin; ilMax = iMax;
+    }
+    else
+      ERRORR(MB_FAILURE, "Couldn't find a suitable partition.");
   }
 #endif
     


More information about the moab-dev mailing list