Skip to content
Snippets Groups Projects
Commit 1b126e17 authored by Markus Blatt's avatar Markus Blatt
Browse files

Fix segmentation fault in AMG if matrix of one rank is empty.

For a matrix with any rows in a parallel run, The subgraph
containing only vertices associated with matrix rows owned by
the process would have 1 vertex although the actual matrix graph
would have none. This is fixed by checking the number of vertices
of the outer graph and act correctly for zero vertices.
For this we need to mark a matrix without rows built in row_wise mode
as built once the CreateIterator is constructed and correct the number
of vertices for a Subgraph of a MatrixGraph with 0 vertices.
parent 5d842379
No related branches found
No related tags found
1 merge request!159Fix segmentation fault in AMG if matrix of one rank is empty.
......@@ -1986,6 +1986,11 @@ namespace Dune
VertexDescriptor* edge=edges_;
// Cater for the case that there are no vertices.
// Otherwise endVertex_ will get 1 below.
if ( graph.noVertices() == 0)
return;
typedef typename Graph::ConstVertexIterator Iterator;
Iterator endVertex=graph.end();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment