[MOAB-dev] r5137 - MOAB/trunk/src/io/mhdf/src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Aug 30 13:12:06 CDT 2011


Author: kraftche
Date: 2011-08-30 13:12:06 -0500 (Tue, 30 Aug 2011)
New Revision: 5137

Modified:
   MOAB/trunk/src/io/mhdf/src/sets.c
Log:
WriteHDF5: handle NULL writes to set description table for parallel collective IO

Modified: MOAB/trunk/src/io/mhdf/src/sets.c
===================================================================
--- MOAB/trunk/src/io/mhdf/src/sets.c	2011-08-30 17:52:24 UTC (rev 5136)
+++ MOAB/trunk/src/io/mhdf/src/sets.c	2011-08-30 18:12:06 UTC (rev 5137)
@@ -235,6 +235,7 @@
   herr_t rval = 0;
   int dims, i;
   const int fill_val = -1;
+  const hsize_t one = 1;
 
   mcounts[0] = count;
   mcounts[1] = 4;
@@ -281,7 +282,15 @@
   counts[0] = (hsize_t)count;
   offsets[0] = (hsize_t)offset;
 
-  mem_id = H5Screate_simple( dims, mcounts, NULL );
+  if (count) 
+    mem_id = H5Screate_simple( dims, mcounts, NULL );
+  else { /* special case for 'NULL' read during collective parallel IO */
+    mem_id = H5Screate_simple( 1, &one, NULL );
+    if (mem_id && 0 > H5Sselect_none( mem_id )) {
+      H5Sclose( mem_id );
+      mem_id = -1;
+    }
+  }
   if (mem_id < 0)
   {
     mhdf_setFail( status, "Internal error calling H5Screate_simple." );
@@ -294,7 +303,7 @@
     offsets[1] = 0;
     if (count) 
       rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
-    else 
+    else /* special case for 'NULL' read during collective parallel IO */
       rval = H5Sselect_none( slab_id );
     if (rval < 0)
     {















More information about the moab-dev mailing list