[MOAB-dev] BCAST_DELETE changes

David Thompson dcthomp at sandia.gov
Mon Aug 11 18:45:25 CDT 2008


Hi all,

I ran into an issue where using the parallel reader with an invalid
filename in BCAST_DELETE mode would cause a hang. I have a patch
(attached) that fixes the issue for me but want to make sure it doesn't
cause trouble for anyone else before checking it in.

The patch also deletes a bit of what appears to be dead code in
resolve_shared_ents(). The code was apparently meant to detect the
maximum that a global ID could be but the results of the MPI_AllReduce
(which sums the number of entities across all processes) don't appear to
be used anywhere.

Any comments before I commit the change?

	Thanks,
	David
-------------- next part --------------
Index: parallel/MBParallelComm.cpp
===================================================================
--- parallel/MBParallelComm.cpp	(revision 2036)
+++ parallel/MBParallelComm.cpp	(working copy)
@@ -536,6 +536,9 @@
 #else
   
   MBErrorCode result = MB_SUCCESS;
+  if ( entities.size() == 0 )
+    return result;
+
   int success;
   MBRange whole_range;
   int buff_size;
@@ -2406,18 +2409,6 @@
     // get a crystal router
   crystal_data *cd = procConfig.crystal_router();
   
-    // get total number of entities; will overshoot highest global id, but
-    // that's ok
-  int num_total = 0, num_local;
-  result = mbImpl->get_number_entities_by_dimension(0, 0, num_local);
-  if (MB_SUCCESS != result) return result;
-  int failure = MPI_Allreduce(&num_local, &num_total, 1,
-                              MPI_INT, MPI_SUM, procConfig.proc_comm());
-  if (failure) {
-    result = MB_FAILURE;
-    RRA("Allreduce for total number of shared ents failed.");
-  }
-  
     // call gather-scatter to get shared ids & procs
   gs_data *gsd;
   assert(sizeof(ulong_) == sizeof(MBEntityHandle));


More information about the moab-dev mailing list