mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user