Skip to content

Commit

Permalink
Circumvent a bug in Trilinos 11.10
Browse files Browse the repository at this point in the history
If we avoid calling GlobalAssemble when copying from an Epetra_FECrsMatrix that uses a
non-local matrix (enabled for Trilinos 11.9 and greater), we do not run into some bad
code in Trilinos causing a segfault. At this point of the code, it is enough if we only
call FillComplete because there should be no communication after all.
  • Loading branch information
kronbichler committed Sep 29, 2014
1 parent f850cb8 commit 280c52a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions source/lac/trilinos_sparse_matrix.cc
Expand Up @@ -392,12 +392,13 @@ namespace TrilinosWrappers
nonlocal_matrix.reset();
nonlocal_matrix_exporter.reset();

// check whether we need to update the
// partitioner or can just copy the data:
// in case we have the same distribution,
// we can just copy the data.
if (local_range() == m.local_range())
*matrix = *m.matrix;
// check whether we need to update the partitioner or can just copy the
// data: in case we have the same distribution, we can just copy the data.
if (&matrix->Graph() == &m.matrix->Graph() && m.matrix->Filled())
{
std::memcpy(matrix->ExpertExtractValues(), m.matrix->ExpertExtractValues(),
matrix->NumMyNonzeros()*sizeof(*matrix->ExpertExtractValues()));
}
else
{
column_space_map.reset (new Epetra_Map (m.domain_partitioner()));
Expand All @@ -410,7 +411,7 @@ namespace TrilinosWrappers
if (m.nonlocal_matrix.get() != 0)
nonlocal_matrix.reset(new Epetra_CrsMatrix(Copy, m.nonlocal_matrix->Graph()));

compress();
matrix->FillComplete(*column_space_map, matrix->RowMap());
}


Expand Down

0 comments on commit 280c52a

Please sign in to comment.