implement explicit prefetching

the main part of this patch is actually an API change of
Ewoms::ThreadedEntityIterator to faciliate the change (since we should
prefetch the data for the element which is to be linarized after the
current one.)  Also, this patch is only an 80% solution: it would be
good if the cached intensive quantities of the model and the stencil
of an element could also be prefetched, but that's currently not
easily possible in a performant way because iterating over the
intersections of an element negates the performance gains obtained by
prefetching.
This commit is contained in:
Andreas Lauser
2016-10-30 18:42:06 +01:00
parent db5eb4249e
commit b31fb57636
2 changed files with 5 additions and 5 deletions

View File

@@ -346,6 +346,9 @@ public:
updatePffDofData_();
}
void prefetch(const Element& elem) const
{ pffDofData_.prefetch(elem); }
/*!
* \brief This method restores the complete state of the well
* from disk.

View File

@@ -407,11 +407,8 @@ public:
#endif
{
ElementContext elemCtx(simulator_);
auto elemIt = simulator_.gridManager().gridView().template begin</*codim=*/0>();
for (threadedElemIt.beginParallel(elemIt);
!threadedElemIt.isFinished(elemIt);
threadedElemIt.increment(elemIt))
{
auto elemIt = threadedElemIt.beginParallel();
for (; !threadedElemIt.isFinished(elemIt); elemIt = threadedElemIt.increment()) {
const Element& elem = *elemIt;
if (elem.partitionType() != Dune::InteriorEntity)
continue;