[MOAB-dev] r5197 - in MOAB/trunk/src/parallel: . moab
hongjun at mcs.anl.gov
hongjun at mcs.anl.gov
Sun Oct 23 22:31:08 CDT 2011
Author: hongjun
Date: 2011-10-23 22:31:07 -0500 (Sun, 23 Oct 2011)
New Revision: 5197
Modified:
MOAB/trunk/src/parallel/ParallelComm.cpp
MOAB/trunk/src/parallel/moab/ParallelComm.hpp
Log:
o check and clean shared tags before exchange meshes
o shared, multi-shared and pstatus are properly set and inserted to sharedEnts vector
o passes make check
Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp 2011-10-22 22:09:34 UTC (rev 5196)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp 2011-10-24 03:31:07 UTC (rev 5197)
@@ -5716,6 +5716,12 @@
exchange_procs_sets.push_back(exchange_procs[i]);
}
+ // check and clean incorrect shared tags
+ result = clean_shared_tags(exchange_ents);
+ RRA("Couldn't clean shared tags.");
+ result = clean_shared_tags(exchange_sets);
+ RRA("Couldn't clean shared tags.");
+
// exchange entities first
result = exchange_owned_mesh(exchange_procs, exchange_ents,
store_remote_handles, wait_all, migrate);
@@ -5728,6 +5734,53 @@
for (int i = 0; i < n_proc; i++) delete exchange_sets[i];
+ // set shared information
+ Tag sharedp = sharedp_tag();
+ Tag sharedps = sharedps_tag();
+ Tag pstatus = pstatus_tag();
+ Range tagged_ents;
+
+ // get shared proc tag entities and add shared pstatus
+ result = mbImpl->get_entities_by_type_and_tag(0, MBMAXTYPE, &sharedp, 0, 1,
+ tagged_ents);
+ RRA("Failed to get sharing proc tag in remote_handles.");
+
+ std::vector<int> shared_procs(tagged_ents.size());
+ result = mbImpl->tag_get_data(sharedp, tagged_ents, &shared_procs[0]);
+ Range::iterator it = tagged_ents.begin();
+ Range::iterator eit = tagged_ents.end();
+ for (int i = 0; it != eit; it++, i++) {
+ unsigned char pstat;
+ pstat |= PSTATUS_SHARED;
+ result = mbImpl->tag_set_data(pstatus_tag(), &(*it), 1, &pstat);
+ RRA("Couldn't set pstatus tag.");
+ sharedEnts.push_back(*it);
+ }
+
+ // get shared proc tag entities and add shared pstatus
+ tagged_ents.clear();
+ result = mbImpl->get_entities_by_type_and_tag(0, MBMAXTYPE, &sharedps, 0, 1,
+ tagged_ents);
+ RRA("Failed to get sharing proc tag in remote_handles.");
+
+ it = tagged_ents.begin();
More information about the moab-dev
mailing list