[MOAB-dev] r4815 - MOAB/trunk/src/parallel
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Wed May 11 16:27:05 CDT 2011
Author: kraftche
Date: 2011-05-11 16:27:05 -0500 (Wed, 11 May 2011)
New Revision: 4815
Modified:
MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
MOAB/trunk/src/parallel/WriteHDF5Parallel.hpp
Log:
small code cleanup in parallel hdf5 writer
Modified: MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
===================================================================
--- MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp 2011-05-11 18:25:44 UTC (rev 4814)
+++ MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp 2011-05-11 21:27:05 UTC (rev 4815)
@@ -238,7 +238,71 @@
const std::string& data )
{ list.push_back( Data(filter,data,filterval) ); }
+ErrorCode
+WriteHDF5Parallel::MultiProcSetTags::Data::get_sets( Interface* moab,
+ Range& sets,
+ Tag& id_tag ) const
+{
+ ErrorCode rval;
+ int size;
+ const void* values[] = { 0, 0 };
+ Tag handles[2];
+ // Get first tag handle: this tag is used to filter sets
+ // (we only return sets for which this tag is set)
+
+ rval = moab->tag_get_handle( filterTag.c_str(), handles[0] );
+ if (MB_TAG_NOT_FOUND == rval)
+ return MB_SUCCESS; // return nothing if tag isn't defined on this proc
+ else if (MB_SUCCESS != rval)
+ return error(rval);
+
+ // Get data tag. This tag contains IDs used to globally identify
+ // sets in the group with the filter_tag. This might be the same
+ // tag as the filter tag.
+
+ rval = moab->tag_get_handle( dataTag.c_str(), handles[1] );
+ if (MB_TAG_NOT_FOUND == rval)
+ return MB_SUCCESS; // return nothing if tag isn't defined on this proc
+ else if (MB_SUCCESS != rval)
+ return error(rval);
+
+ moab->tag_get_size( handles[1], size );
+ if (size != (int)sizeof(int)) {
+ fprintf(stderr, "Cannot use non-int tag data for matching remote sets.\n" );
+ assert(0);
+ return error(MB_FAILURE);
+ }
+
+ // We can optionally also filter on the value of the filter tag.
+ // (e.g. GEOM_DIMENSION)
+
+ if (useFilterValue) {
+ moab->tag_get_size( handles[0], size );
+ if (size != (int)sizeof(int)) {
+ fprintf(stderr, "Cannot use non-int tag data for filtering remote sets.\n" );
More information about the moab-dev
mailing list