mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Prevent problems to due oversight in parallel AMG.
Currently we run into issues with the parallel AMG if redistribution happened on the coarsest level. That is not detected by AMG and it will construct smoothers on all processors present before the redistribution. Some of them will get OwnerOverlapCommunication objects that have an invalid MPI communicator in them (MPI_COMM_NULL) and an MPI_ERROR will be raised as we communicate in the constructor. With this patch we detect this situaton and set the pointer to OwnerOverlapCommunication to null to prevent communication. A sanity check that the matrix has zero rows has been added.
This commit is contained in:
parent
28e566ba02
commit
6bcfce1733
@ -420,6 +420,22 @@ public:
|
||||
protected:
|
||||
void init( const Matrix& A, const int iluIteration )
|
||||
{
|
||||
// (For older DUNE versions the communicator might be
|
||||
// invalid if redistribution in AMG happened on the coarset level.
|
||||
// Therefore we check for nonzero size
|
||||
if ( comm_ && comm_->communicator().size()<=0 )
|
||||
{
|
||||
if ( A.N() > 0 )
|
||||
{
|
||||
OPM_THROW(std::logic_error, "Expected a matrix with zero rows for an invalid communicator.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// simply set the communicator to null
|
||||
comm_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
int ilu_setup_successful = 1;
|
||||
std::string message;
|
||||
const int rank = ( comm_ ) ? comm_->communicator().rank() : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user