[MOAB-dev] r4997 - MOAB/trunk/src/parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Jun 14 09:21:07 CDT 2011


Author: kraftche
Date: 2011-06-14 09:21:02 -0500 (Tue, 14 Jun 2011)
New Revision: 4997

Modified:
   MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
Log:
fix bug writing HDF5 file with no vertices in parallel

Modified: MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
===================================================================
--- MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp	2011-06-13 23:41:09 UTC (rev 4996)
+++ MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp	2011-06-14 14:21:02 UTC (rev 4997)
@@ -1134,17 +1134,18 @@
   
     // create node data in file
   long first_id_and_max_count[3];
-  if (myPcomm->proc_config().proc_rank() == 0 && num_nodes)
+  if (myPcomm->proc_config().proc_rank() == 0)
   {
     int total = 0;
     for (unsigned int i = 0; i < myPcomm->proc_config().proc_size(); i++)
       total += node_counts[i];
     
     nodeSet.total_num_ents = total;
-    hid_t handle = mhdf_createNodeCoords( filePtr, dimension, total, &first_id_and_max_count[0], &status );
-    CHECK_HDF(status);
-    mhdf_closeData( filePtr, handle, &status );
-    
+    if (total) {
+      hid_t handle = mhdf_createNodeCoords( filePtr, dimension, total, &first_id_and_max_count[0], &status );
+      CHECK_HDF(status);
+      mhdf_closeData( filePtr, handle, &status );
+    }
     first_id_and_max_count[1] = *std::max_element( node_counts.begin(), node_counts.end() );
     first_id_and_max_count[2] = total;
   }

























More information about the moab-dev mailing list