[MOAB-dev] r5818 - in MOAB/trunk: src/io src/parallel test/parallel

iulian at mcs.anl.gov iulian at mcs.anl.gov
Mon Oct 22 10:38:48 CDT 2012


Author: iulian
Date: 2012-10-22 10:38:48 -0500 (Mon, 22 Oct 2012)
New Revision: 5818

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
   MOAB/trunk/src/parallel/ParallelComm.cpp
   MOAB/trunk/test/parallel/ucdnodpart.cpp
Log:
fix nodal based partition prototype, that should be used only for unstructured
homme grids.

advantage
 - contiguous reads of nodal based data on each processor, 
limitations:
 - it does not create any interface sets between processors and does not
   create yet any edges at those interfaces. 
 - so it cannot be used yet to ghost elements between processors
 - the elements are distributed to processors according to a simple rule: 
    look at the lowest node id, and put it in the processor that owns it;
     it could mean that some nodes are not connected to any elements 
   in the local processor
 - should use it with read option "PARTITION_METHOD=NODAL_PARTITION;", and 
 should not use the option "PARALLEL_RESOLVE_SHARED_ENTS"; the resolve of the 
  nodes is done as part of the read. 

It is a partition that should be used, for the time being, only for reading 
node based data in homme grids. 




Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2012-10-22 02:52:55 UTC (rev 5817)
+++ MOAB/trunk/src/io/ReadNC.cpp	2012-10-22 15:38:48 UTC (rev 5818)
@@ -254,12 +254,9 @@
 
   // Read variables onto grid
   if (!novars) {
-    if (!npMesh) {
-      rval = read_variables(tmp_set, var_names, tstep_nums);
-      if (MB_FAILURE == rval)
-        return rval;
-    }
-
+    rval = read_variables(tmp_set, var_names, tstep_nums);
+    if (MB_FAILURE == rval)
+      return rval;
   }
   else {
     // read dimension variable by default
@@ -891,6 +888,11 @@
   ERRORS(success, "Failed on close.");
 
   std::vector<char>  flag(num_total_nodes, 0);
+  // all the nodes from start id to end id will automatically get flag 1, because
+  // they will be on this processor
+  for (int ii=start_gid-1; ii<end_gid; ii++)
+    flag[ii]=1;
+
   std::vector<int> local_connec;
   local_connec.reserve(4*num_owned_nodes);// there are about the same number of nodes as elements
   std::vector<int> local_elem_gid;
@@ -939,8 +941,9 @@
       local_elem_gid.push_back(ie+1);
     }
     // all nodes get mark 1
-    for (int i=0; i<num_total_nodes; i++)
-      flag[i]=1;
+    // not needed anymore, all nodes got flag 1 in serial
+   /* for (int i = 0; i < num_total_nodes; i++)
+      flag[i] = 1;*/
   }
 
   // create all nodes that have the flag 1; some will be owned by other procs, we can set the PSTATUS flag
@@ -1042,6 +1045,9 @@
     assert(myPcomm);
     if (localdebug)
     {
+      std::cout<<" local quads" <<local_elem_gid.size()<<
+          " local nodes"<<  num_local_verts << "\n";
+     std::cout<< " start_gid " <<    start_gid << " end_gid" << end_gid<< "\n";


More information about the moab-dev mailing list