[MOAB-dev] r5113 - in MOAB/trunk: src/io src/parallel test/parallel
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Wed Aug 24 17:28:49 CDT 2011
Author: kraftche
Date: 2011-08-24 17:28:45 -0500 (Wed, 24 Aug 2011)
New Revision: 5113
Modified:
MOAB/trunk/src/io/WriteHDF5.cpp
MOAB/trunk/src/io/WriteHDF5.hpp
MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
MOAB/trunk/src/parallel/WriteHDF5Parallel.hpp
MOAB/trunk/test/parallel/parallel_write_test.cc
Log:
HDF5 writer improvements to handling shared sets:
o Rely on ParallelComm to establish/track set sharing
o Communicate all data for shared sets to set owner before writing
Modified: MOAB/trunk/src/io/WriteHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/WriteHDF5.cpp 2011-08-24 22:27:20 UTC (rev 5112)
+++ MOAB/trunk/src/io/WriteHDF5.cpp 2011-08-24 22:28:45 UTC (rev 5113)
@@ -346,7 +346,7 @@
const char* WriteHDF5::ExportSet::name() const
{
- static char buffer[32];
+ static char buffer[128];
switch (type) {
case MBVERTEX:
return mhdf_node_type_handle();
@@ -1187,10 +1187,13 @@
// the total number of write calls that must be made, including no-ops for collective io
const size_t num_total_writes = (max_vals + buffer_size-1)/buffer_size;
+ std::vector<SpecialSetData>::iterator si = specialSets.begin();
+
std::vector<id_t> remaining; // data left over from prev iteration because it didn't fit in buffer
size_t remaining_offset = 0; // avoid erasing from front of 'remaining'
const EntityHandle* remaining_ptr = 0; // remaining for non-ranged data
size_t remaining_count = 0;
+ const id_t* special_rem_ptr = 0;
Range::const_iterator i = setSet.range.begin(), j, rhint, nshint;
if (ranged) rhint = ranged->begin();
if (null_stripped) nshint = null_stripped->begin();
@@ -1238,11 +1241,47 @@
remaining_count = 0;
}
}
+ // If we had some left-over data from a "special" (i.e. parallel shared)
+ // set.
+ else if (special_rem_ptr) {
+ if (remaining_count > buffer_size) {
+ memcpy( buffer, special_rem_ptr, buffer_size*sizeof(id_t) );
+ count = buffer_size;
+ special_rem_ptr += count;
+ remaining_count -= count;
+ }
+ else {
+ memcpy( buffer, special_rem_ptr, remaining_count*sizeof(id_t) );
+ count = remaining_count;
+ special_rem_ptr = 0;
+ remaining_count = 0;
+ }
+ }
// While there is both space remaining in the buffer and
// more sets to write, append more set data to buffer.
More information about the moab-dev
mailing list