[MOAB-dev] Fwd: r4614 - in MOAB/trunk/src/parallel: . moab
Tim Tautges
tautges at mcs.anl.gov
Mon Mar 21 08:54:13 CDT 2011
Note these last few changes I made to shared entity negotiation decreased the execution time in that part of the
parallel load process by about 90% for some meshes (mostly, for tet meshes with lots of fragmentation; for hex meshes
the times were almost identical).
- tim
-------- Original Message --------
Subject: [MOAB-dev] r4614 - in MOAB/trunk/src/parallel: . moab
Date: Fri, 18 Mar 2011 21:38:42 -0500 (CDT)
From: tautges at mcs.anl.gov
Reply-To: moab-dev at mcs.anl.gov
To: moab-dev at mcs.anl.gov
Author: tautges
Date: 2011-03-18 21:38:42 -0500 (Fri, 18 Mar 2011)
New Revision: 4614
Modified:
MOAB/trunk/src/parallel/ParallelComm.cpp
MOAB/trunk/src/parallel/moab/ParallelComm.hpp
Log:
Making sharedEnts a std::vector instead of a range.
Passes make check and separate mbconvert test.
Modified: MOAB/trunk/src/parallel/ParallelComm.cpp
===================================================================
--- MOAB/trunk/src/parallel/ParallelComm.cpp 2011-03-18 23:45:20 UTC (rev 4613)
+++ MOAB/trunk/src/parallel/ParallelComm.cpp 2011-03-19 02:38:42 UTC (rev 4614)
@@ -2057,12 +2057,14 @@
ErrorCode ParallelComm::list_entities(const EntityHandle *ents, int num_ents)
{
if (NULL == ents && 0 == num_ents) {
- sharedEnts.print("Shared entities:\n");
+ Range shared_ents;
+ std::copy(sharedEnts.begin(), sharedEnts.end(), range_inserter(shared_ents));
+ shared_ents.print("Shared entities:\n");
return MB_SUCCESS;
}
else if (NULL == ents && 0 != num_ents) {
- return list_entities(sharedEnts);
+ return list_entities(&sharedEnts[0], sharedEnts.size());
}
unsigned char pstat;
@@ -2287,7 +2289,7 @@
result = mbImpl->tag_set_data(pstatus_tag(), &new_h, 1, &pstat);
RRA("Couldn't set pstatus tag.");
- if (pstat & PSTATUS_SHARED) sharedEnts.insert(new_h);
+ if (pstat & PSTATUS_SHARED) sharedEnts.push_back(new_h);
return MB_SUCCESS;
}
@@ -3683,15 +3685,15 @@
ErrorCode result;
int nprocs;
unsigned char pstat;
- for (Range::iterator rit = sharedEnts.begin(); rit != sharedEnts.end(); rit++) {
- if (shared_dim != -1 && mbImpl->dimension_from_handle(*rit) > shared_dim)
+ for (std::vector<EntityHandle>::iterator vit = sharedEnts.begin(); vit != sharedEnts.end(); vit++) {
+ if (shared_dim != -1 && mbImpl->dimension_from_handle(*vit) > shared_dim)
continue;
- result = get_sharing_data(*rit, procs, handles, pstat, nprocs);
+ result = get_sharing_data(*vit, procs, handles, pstat, nprocs);
RRA("");
std::sort(procs, procs+nprocs);
std::vector<int> tmp_procs(procs, procs + nprocs);
assert(tmp_procs.size() != 2);
- proc_nvecs[tmp_procs].push_back(*rit);
+ proc_nvecs[tmp_procs].push_back(*vit);
}
Skinner skinner(mbImpl);
@@ -3977,7 +3979,7 @@
More information about the moab-dev
mailing list