EclWellManager: do not use parallelism

the speedup gained by parallelism here are simply not worth the
headaches.

note that `flow` is unaffected by this because it uses
`Opm::BlackoilWellModel`.
This commit is contained in:
Andreas Lauser 2019-03-01 10:36:29 +01:00
parent 43dd9928b4
commit 8e5f1279f3

View File

@ -406,24 +406,20 @@ public:
wells_[wellIdx]->beginIterationPreProcess(); wells_[wellIdx]->beginIterationPreProcess();
// call the accumulation routines // call the accumulation routines
ThreadedEntityIterator<GridView, /*codim=*/0> threadedElemIt(simulator_.vanguard().gridView()); ElementContext elemCtx(simulator_);
#ifdef _OPENMP const auto gridView = simulator_.vanguard().gridView();
#pragma omp parallel auto elemIt = gridView.template begin</*codim=*/0>();
#endif const auto& elemEndIt = gridView.template end</*codim=*/0>();
{ for (; elemIt != elemEndIt; ++elemIt) {
ElementContext elemCtx(simulator_); const Element& elem = *elemIt;
auto elemIt = threadedElemIt.beginParallel(); if (elem.partitionType() != Dune::InteriorEntity)
for (; !threadedElemIt.isFinished(elemIt); elemIt = threadedElemIt.increment()) { continue;
const Element& elem = *elemIt;
if (elem.partitionType() != Dune::InteriorEntity)
continue;
elemCtx.updatePrimaryStencil(elem); elemCtx.updatePrimaryStencil(elem);
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0); elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
for (size_t wellIdx = 0; wellIdx < wellSize; ++wellIdx) for (size_t wellIdx = 0; wellIdx < wellSize; ++wellIdx)
wells_[wellIdx]->beginIterationAccumulate(elemCtx, /*timeIdx=*/0); wells_[wellIdx]->beginIterationAccumulate(elemCtx, /*timeIdx=*/0);
}
} }
// call the postprocessing routines // call the postprocessing routines