[MOAB-dev] r3052 - MOAB/trunk
kraftche at mcs.anl.gov
kraftche at mcs.anl.gov
Wed Jul 22 14:12:16 CDT 2009
Author: kraftche
Date: 2009-07-22 14:12:16 -0500 (Wed, 22 Jul 2009)
New Revision: 3052
Modified:
MOAB/trunk/WriteHDF5.cpp
MOAB/trunk/WriteHDF5.hpp
Log:
o Fix corrupt set contents data
o Make buffer size controllable with an option (for debugging)
Modified: MOAB/trunk/WriteHDF5.cpp
===================================================================
--- MOAB/trunk/WriteHDF5.cpp 2009-07-22 17:35:39 UTC (rev 3051)
+++ MOAB/trunk/WriteHDF5.cpp 2009-07-22 19:12:16 UTC (rev 3052)
@@ -341,6 +341,12 @@
{
mhdf_Status status;
+ bufferSize = WRITE_HDF5_BUFFER_SIZE;
+ int buf_size;
+ MBErrorCode rval = opts.get_int_option( "BUFFER_SIZE", buf_size );
+ if (MB_SUCCESS == rval && buf_size >= 24)
+ bufferSize = buf_size;
+
// Allocate internal buffer to use when gathering data to write.
dataBuffer = (char*)malloc( bufferSize );
if (!dataBuffer)
@@ -974,7 +980,7 @@
++chunk_size;
content_chunk_size = (bufferSize - 4*sizeof(long)*chunk_size)/sizeof(id_t);
assert(content_chunk_size>0);
- content_buffer = reinterpret_cast<id_t*>(buffer+chunk_size);
+ content_buffer = reinterpret_cast<id_t*>(buffer+4*chunk_size);
}
MBRange set_contents;
Modified: MOAB/trunk/WriteHDF5.hpp
===================================================================
--- MOAB/trunk/WriteHDF5.hpp 2009-07-22 17:35:39 UTC (rev 3051)
+++ MOAB/trunk/WriteHDF5.hpp 2009-07-22 19:12:16 UTC (rev 3052)
@@ -212,7 +212,7 @@
protected:
//! The size of the data buffer (<code>dataBuffer</code>).
- const int bufferSize;
+ size_t bufferSize;
//! A memory buffer to use for all I/O operations.
char* dataBuffer;
More information about the moab-dev
mailing list