mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-16 15:51:57 -06:00
Merge pull request #823 from atgeirr/parallel-nldd-fixes
Avoid collective operations in single-domain calls.
This commit is contained in:
commit
19bde5f5ec
@ -239,12 +239,7 @@ public:
|
||||
const GlobalEqVector& currentResidual,
|
||||
const DofIndices& dofIndices)
|
||||
{
|
||||
const auto& comm = this->simulator_.gridView().comm();
|
||||
|
||||
int succeeded;
|
||||
try {
|
||||
auto zero = solutionUpdate[0];
|
||||
zero = 0.0;
|
||||
const auto zero = 0.0 * solutionUpdate[0];
|
||||
for (auto dofIdx : dofIndices) {
|
||||
if (solutionUpdate[dofIdx] == zero) {
|
||||
continue;
|
||||
@ -255,17 +250,6 @@ public:
|
||||
solutionUpdate[dofIdx],
|
||||
currentResidual[dofIdx]);
|
||||
}
|
||||
succeeded = 1;
|
||||
}
|
||||
catch (...) {
|
||||
succeeded = 0;
|
||||
}
|
||||
succeeded = comm.min(succeeded);
|
||||
|
||||
if (!succeeded)
|
||||
throw NumericalProblem("A process did not succeed in adapting the primary variables");
|
||||
|
||||
numPriVarsSwitched_ = comm.sum(numPriVarsSwitched_);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -191,7 +191,29 @@ public:
|
||||
*/
|
||||
void linearizeDomain()
|
||||
{
|
||||
int succeeded;
|
||||
try {
|
||||
linearizeDomain(fullDomain_);
|
||||
succeeded = 1;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cout << "rank " << simulator_().gridView().comm().rank()
|
||||
<< " caught an exception while linearizing:" << e.what()
|
||||
<< "\n" << std::flush;
|
||||
succeeded = 0;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "rank " << simulator_().gridView().comm().rank()
|
||||
<< " caught an exception while linearizing"
|
||||
<< "\n" << std::flush;
|
||||
succeeded = 0;
|
||||
}
|
||||
succeeded = simulator_().gridView().comm().min(succeeded);
|
||||
|
||||
if (!succeeded)
|
||||
throw NumericalProblem("A process did not succeed in linearizing the system");
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -222,29 +244,7 @@ public:
|
||||
resetSystem_(domain);
|
||||
}
|
||||
|
||||
int succeeded;
|
||||
try {
|
||||
linearize_(domain);
|
||||
succeeded = 1;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cout << "rank " << simulator_().gridView().comm().rank()
|
||||
<< " caught an exception while linearizing:" << e.what()
|
||||
<< "\n" << std::flush;
|
||||
succeeded = 0;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "rank " << simulator_().gridView().comm().rank()
|
||||
<< " caught an exception while linearizing"
|
||||
<< "\n" << std::flush;
|
||||
succeeded = 0;
|
||||
}
|
||||
succeeded = simulator_().gridView().comm().min(succeeded);
|
||||
|
||||
if (!succeeded)
|
||||
throw NumericalProblem("A process did not succeed in linearizing the system");
|
||||
}
|
||||
|
||||
void finalize()
|
||||
|
Loading…
Reference in New Issue
Block a user