[MOAB-dev] r4533 - MOAB/trunk/src/parallel
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Mon Feb 28 14:32:05 CST 2011
Author: kraftche
Date: 2011-02-28 14:32:05 -0600 (Mon, 28 Feb 2011)
New Revision: 4533
Modified:
MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
Log:
.h5m collective IO for shared set descriptions
Modified: MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
===================================================================
--- MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp 2011-02-28 19:36:32 UTC (rev 4532)
+++ MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp 2011-02-28 20:32:05 UTC (rev 4533)
@@ -28,6 +28,7 @@
#include <H5Ppublic.h>
#include <H5FDmpi.h>
#include <H5FDmpio.h>
+#include <H5Spublic.h>
#include "mhdf.h"
@@ -2106,8 +2107,33 @@
const id_t start_id = setSet.first_id;
ErrorCode rval;
- mhdf_Status status;
+ // Count number of parallel sets for which we need to write
+ // the description
+ std::list<ParallelSet>::const_iterator iter;
+ size_t count = 0;
+ for (iter = parallelSets.begin(); iter != parallelSets.end(); ++iter)
+ if (iter->description)
+ ++count;
+
+ // get a large enough buffer for all of the shared set metadata
+ std::vector<long> tmp_buffer;
+ size_t buffer_size = bufferSize / (4*sizeof(long));
+ long* buffer;
+ if (buffer_size >= count) {
+ buffer = reinterpret_cast<long*>(dataBuffer);
+ }
+ else {
+ tmp_buffer.resize(4 * count);
+ buffer = &tmp_buffer[0];
+ }
+
+ // get a buffer for offset locations
+ std::vector<hsize_t> coords;
+ coords.reserve(8 * count);
+
+
+ long* buff_iter = buffer;
for( std::list<ParallelSet>::const_iterator iter = parallelSets.begin();
iter != parallelSets.end(); ++iter)
{
@@ -2126,17 +2152,52 @@
return error(rval);
// Write the data
More information about the moab-dev
mailing list