[MOAB-dev] r5109 - in MOAB/trunk/src: . io

tautges at mcs.anl.gov tautges at mcs.anl.gov
Wed Aug 24 17:04:52 CDT 2011


Author: tautges
Date: 2011-08-24 17:04:51 -0500 (Wed, 24 Aug 2011)
New Revision: 5109

Modified:
   MOAB/trunk/src/ScdInterface.cpp
   MOAB/trunk/src/io/ReadNC.cpp
Log:
Lots of debugging of deterministic shared vertex identification.  Unit tests now work for 4 processors.

Passes make check in serial and parallel.



Modified: MOAB/trunk/src/ScdInterface.cpp
===================================================================
--- MOAB/trunk/src/ScdInterface.cpp	2011-08-23 19:36:09 UTC (rev 5108)
+++ MOAB/trunk/src/ScdInterface.cpp	2011-08-24 22:04:51 UTC (rev 5109)
@@ -663,6 +663,9 @@
   int I = (gijk[3] - gijk[0]), J = (gijk[4] - gijk[1]);
   int iextra = I%pi, jextra = J%pj, i = I/pi, j = J/pj;
   int nri = nr % pi, nrj = nr / pi;
+//
+// pi, pj = # blocks in i, j directions
+// nri, nrj = column, row of this processor's block
   if (lijk) {
     lijk[0] = i*nri + std::min(iextra, nri);
     lijk[3] = lijk[0] + i + (nri < iextra ? 1 : 0);
@@ -838,26 +841,65 @@
   pto = -1;
   bdy_ind[0] = bdy_ind[1] = -1;
   int pj, pk; // pj, pk: # procs in j, k directions
-  ErrorCode rval = compute_partition_alljkbal(np, nr, box->global_box_dims(), facedims, &pj);
+  ErrorCode rval = compute_partition_alljkbal(np, nr, box->global_box_dims(), rdims, &pj);
   if (MB_SUCCESS != rval) return rval;
   pk = np / pj;
   assert(pj * pk == np);
   pto = -1;
-  if ((nr < pj && -1 == dijk[1] && !box->is_periodic_j()) ||  // down and not periodic
-      (nr > np-pj && 1 == dijk[1] && !box->is_periodic_j()))  // up and not periodic
+  if (1 == pk && dijk[2]) return MB_SUCCESS; // 1d in j means no neighbors with dk != 0
+  if ((nr < pk && -1 == dijk[1] && !box->is_periodic_j()) ||  // down and not periodic
+      (nr >= np-pk && 1 == dijk[1] && !box->is_periodic_j()))  // up and not periodic
     return MB_SUCCESS;
     
+  pto = nr;
+  
   if (0 != dijk[1]) {
-    pto = (nr + dijk[1]*(gdims[4]-gdims[1])/pj) % np;
-    facedims[1] = facedims[4] = (-1 == dijk[1] ? facedims[1] : facedims[4]);
+    pto = (pto + dijk[1]*pk) % np;
+    assert (pto >= 0 && pto < np);
+    int dj = (gdims[4] - gdims[1]) / pj, extra = (gdims[4] - gdims[1]) % dj;
+    if (-1 == dijk[1]) {
+      facedims[4] = facedims[1];
+      rdims[4] = rdims[1];
+      rdims[1] -= dj;
+      if (pto < extra) rdims[1]--;
+    }
+    else {
+      facedims[1] = facedims[4];
+      rdims[1] = rdims[4];
+      rdims[4] += dj;
+      if (pto < extra) rdims[4]++;
+    }


More information about the moab-dev mailing list