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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Fri May 6 18:13:40 CDT 2011


Author: kraftche
Date: 2011-05-06 18:13:40 -0500 (Fri, 06 May 2011)
New Revision: 4806

Modified:
   MOAB/trunk/src/io/ReadHDF5.cpp
   MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
Log:
clean up the last few spots where the HDF5 library reverts to independent IO when we asked for collective

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2011-05-06 21:31:47 UTC (rev 4805)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2011-05-06 23:13:40 UTC (rev 4806)
@@ -1252,19 +1252,25 @@
     return error(MB_FAILURE);
   }
   
+  hid_t file_type = H5Dget_type( tables[0] );
+  if (file_type < 0) 
+    return error(MB_FAILURE);
+  
   hint = file_ids.begin();
   EntityHandle* buffer = reinterpret_cast<EntityHandle*>(dataBuffer);
-  const long buffer_size = bufferSize / sizeof(EntityHandle);
+  const long buffer_size = bufferSize / std::max(sizeof(EntityHandle),H5Tget_size(file_type));
   long remaining = size, offset = 0;
   while (remaining) {
     long count = std::min( buffer_size, remaining );
     assert_range( buffer, count );
     mhdf_readSparseTagEntitiesWithOpt( *tables, offset, count, 
-                                handleType, buffer, collIO, &status );
+                                file_type, buffer, collIO, &status );
     if (is_error(status)) {
+      H5Tclose(file_type);
       mhdf_closeData( filePtr, *tables, &status );
       return error(MB_FAILURE);
     }
+    H5Tconvert( file_type, handleType, count, buffer, NULL, H5P_DEFAULT );
     
     std::sort( buffer, buffer + count );
     for (long i = 0; i < count; ++i)
@@ -1274,6 +1280,7 @@
     offset += count;
   }
 
+  H5Tclose(file_type);
   mhdf_closeData( filePtr, *tables, &status );
   if (is_error(status))
     return error(MB_FAILURE);
@@ -1292,14 +1299,14 @@
   CHECK_OPEN_HANDLES;
 
   mhdf_Status status;
-  size_t chunk_size = bufferSize / sizeof(unsigned);
-  unsigned * buffer = reinterpret_cast<unsigned*>(dataBuffer);
+  size_t chunk_size = bufferSize / sizeof(int);
+  int * buffer = reinterpret_cast<int*>(dataBuffer);
   size_t remaining = table_size, offset = 0;
   while (remaining) {
       // Get a block of tag values


More information about the moab-dev mailing list