[MOAB-dev] r2749 - MOAB/trunk/mhdf/src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Mar 25 15:53:49 CDT 2009


Author: kraftche
Date: 2009-03-25 15:53:49 -0500 (Wed, 25 Mar 2009)
New Revision: 2749

Modified:
   MOAB/trunk/mhdf/src/sets.c
   MOAB/trunk/mhdf/src/util.c
Log:
allow zero-length read/writes so that if/when we have the option of using collective rather than indpendent parallel HDF5 read/write calls.

Modified: MOAB/trunk/mhdf/src/sets.c
===================================================================
--- MOAB/trunk/mhdf/src/sets.c	2009-03-25 20:11:00 UTC (rev 2748)
+++ MOAB/trunk/mhdf/src/sets.c	2009-03-25 20:53:49 UTC (rev 2749)
@@ -262,7 +262,7 @@
   mem_id = H5Screate_simple( dims, mcounts, NULL );
   if (mem_id < 0)
   {
-    mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
+    mhdf_setFail( status, "Internal error calling H5Screate_simple." );
     return 0;
   }
   
@@ -270,7 +270,10 @@
   if (counts[1] == 4)
   {
     offsets[1] = 0;
-    rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+    if (count) 
+      rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+    else 
+      rval = H5Sselect_none( slab_id );
     if (rval < 0)
     {
       H5Sclose( mem_id );
@@ -301,7 +304,10 @@
       
       counts[1] = 1;
       offsets[1] = i;
-      rval = H5Sselect_hyperslab( sslab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+      if (count)
+        rval = H5Sselect_hyperslab( sslab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+      else
+        rval = H5Sselect_none( sslab_id );
       if (rval < 0)
       {
         H5Sclose( slab_id );
@@ -475,7 +481,7 @@
   mem_id = H5Screate_simple( 1, &mcount, NULL );
   if (mem_id < 0) {
     H5Sclose( slab_id );
-    mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
+    mhdf_setFail( status, "Internal error calling H5Screate_simple." );
     return 0;
   }
   
@@ -516,7 +522,10 @@
   offsets[0] = (hsize_t)offset;
   counts[0] = (hsize_t)count;
   counts[1] = 1; /* one column */
-  rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+  if (count) 
+    rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+  else
+    rval = H5Sselect_none( slab_id );
   if (rval < 0)
   {
     H5Sclose( mem_id );

Modified: MOAB/trunk/mhdf/src/util.c
===================================================================
--- MOAB/trunk/mhdf/src/util.c	2009-03-25 20:11:00 UTC (rev 2748)
+++ MOAB/trunk/mhdf/src/util.c	2009-03-25 20:53:49 UTC (rev 2749)
@@ -344,7 +344,10 @@
   counts[0] = (hsize_t)count;
   offsets[0] = (hsize_t)offset;
   offsets[1] = 0;
-  rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+  if (count) 
+    rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+  else 
+    rval = H5Sselect_none( slab_id );
   if (rval < 0)
   {
     H5Sclose( slab_id );
@@ -356,7 +359,7 @@
   if (mem_id < 0)
   {
     H5Sclose( slab_id );
-    mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
+    mhdf_setFail( status, "Internal error calling H5Screate_simple." );
     return 0;
   }
   
@@ -441,7 +444,10 @@
   offsets[0] = (hsize_t)offset;
   counts[1] = 1;
   offsets[1] = column;
-  rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+  if (count)
+    rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
+  else 
+    rval = H5Sselect_none( slab_id );
   if (rval < 0)
   {
     H5Sclose( slab_id );
@@ -453,7 +459,7 @@
   if (mem_id < 0)
   {
     H5Sclose( slab_id );
-    mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
+    mhdf_setFail( status, "Internal error calling H5Screate_simple." );
     return 0;
   }
 



More information about the moab-dev mailing list