ebos: abort the program correctly in the parallel case

all processes must be aborted, whilst the error message should only be
printed once. Also, calling std::exit(1) results in "nicer" output (at
least on openMPI) because mpirun does not try to print a stack trace
for every process.
This commit is contained in:
Andreas Lauser
2016-01-24 18:17:22 +01:00
parent 003983cc87
commit c29780856f
+7 -6
View File
@@ -130,12 +130,13 @@ public:
int mpiSize = 1;
MPI_Comm_rank(MPI_COMM_WORLD, &mpiRank);
MPI_Comm_size(MPI_COMM_WORLD, &mpiSize);
if (mpiRank == 0 && mpiSize > 1) {
// TODO: remove the two statements below as soon as Dune::CpGrid works
// correctly for the Norne deck!
std::cerr << "Since Dune::CpGrid is buggy when load balancing, "
<< "ebos currently disables parallelism when using Dune::CpGrid.\n";
std::abort();
if (mpiSize > 1) {
// TODO: always load balance as soon as Dune::CpGrid works correctly for the
// Norne deck!
if (mpiRank == 0)
std::cerr << "Since Dune::CpGrid is buggy when load balancing, "
<< "ebos currently disables parallelism when using Dune::CpGrid.\n";
std::exit(1);
// distribute the grid and switch to the distributed view.
grid_->loadBalance();