[MOAB-dev] r4547 - MOAB/trunk/src/parallel
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Tue Mar 8 08:04:09 CST 2011
Author: kraftche
Date: 2011-03-08 08:04:09 -0600 (Tue, 08 Mar 2011)
New Revision: 4547
Modified:
MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
Log:
add some extra debug/checking to parallel HDF5 writer
Modified: MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
===================================================================
--- MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp 2011-03-08 01:13:50 UTC (rev 4546)
+++ MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp 2011-03-08 14:04:09 UTC (rev 4547)
@@ -2327,6 +2327,37 @@
}
}
+#ifndef NDEBUG
+ // check that writer is correct with regards to which entities
+ // that it owns by verifying that the file ids that we thought
+ // we were sending where not received instead
+ file_id_vect.resize( imesh.size() );
+ rval = iFace->tag_get_data( file_id_tag, imesh, &file_id_vect[0] );
+ if (MB_SUCCESS != rval) {
+ iFace->tag_delete( file_id_tag );
+ return error(rval);
+ }
+ int invalid_count = 0;
+ j = file_id_vect.begin();
+ for (i = imesh.begin(); i != imesh.end(); ++i, ++j) {
+ EntityHandle h = idMap.find(*i);
+ if (*j != h) {
+ ++invalid_count;
+ dbgOut.printf(1,"Conflicting owneship for %s %ld\n",
+ CN::EntityTypeName(TYPE_FROM_HANDLE(*i)),
+ (long)ID_FROM_HANDLE(*i));
+ }
+ }
+ if (invalid_count) {
+ writeUtil->report_error("%d entities with conflicting ownership found "
+ "by process %u. This will result in duplicate "
+ "entities written to file.\n",
+ invalid_count, myPcomm->proc_config().proc_rank() );
+ iFace->tag_delete( file_id_tag );
+ return MB_FAILURE;
+ }
+#endif
+
return iFace->tag_delete( file_id_tag );
}
More information about the moab-dev
mailing list