SparsityPattern::SparsityPattern (const Epetra_Map &InputMap,
const std::vector<unsigned int> &n_entries_per_row)
:
- communicator (Utilities::Trilinos::duplicate_communicator (InputMap.Comm())),
+ communicator (Utilities::Trilinos::
+ duplicate_communicator (InputMap.Comm())),
row_map (Utilities::Trilinos::duplicate_map (InputMap, *communicator)),
col_map (row_map),
compressed (false),
const Epetra_Map &InputColMap,
const unsigned int n_entries_per_row)
:
- communicator (Utilities::Trilinos::duplicate_communicator (InputRowMap.Comm())),
- row_map (Utilities::Trilinos::duplicate_map (InputRowMap, *communicator)),
- col_map (Utilities::Trilinos::duplicate_map (InputColMap, *communicator)),
+ communicator (Utilities::Trilinos::
+ duplicate_communicator (InputRowMap.Comm())),
+ row_map (Utilities::Trilinos::
+ duplicate_map (InputRowMap, *communicator)),
+ col_map (Utilities::Trilinos::
+ duplicate_map (InputColMap, *communicator)),
compressed (false),
graph (row_map.Comm().NumProc() > 1 ?
(std::auto_ptr<Epetra_FECrsGraph>
const Epetra_Map &InputColMap,
const std::vector<unsigned int> &n_entries_per_row)
:
- communicator (Utilities::Trilinos::duplicate_communicator (InputRowMap.Comm())),
- row_map (Utilities::Trilinos::duplicate_map (InputRowMap, *communicator)),
- col_map (Utilities::Trilinos::duplicate_map (InputColMap, *communicator)),
+ communicator (Utilities::Trilinos::
+ duplicate_communicator (InputRowMap.Comm())),
+ row_map (Utilities::Trilinos::
+ duplicate_map (InputRowMap, *communicator)),
+ col_map (Utilities::Trilinos::
+ duplicate_map (InputColMap, *communicator)),
compressed (false),
graph (row_map.Comm().NumProc() > 1 ?
(std::auto_ptr<Epetra_FECrsGraph>
SparsityPattern::~SparsityPattern ()
- {}
+ {
+// this is sorta tricky. we can't destroy the communicator here
+// if we have initialized a matrix with it because the matrix
+// keeps a reference count to the sparsity pattern and so
+// the communicator has to stay alive even though the sparsity
+// pattern goes out of scope :-(
+//
+// TODO: find a way to fix this
+// Utilities::Trilinos::destroy_communicator (*communicator);
+ }
const Epetra_Map &input_col_map,
const unsigned int n_entries_per_row)
{
+ Utilities::Trilinos::destroy_communicator (*communicator);
communicator.reset (Utilities::Trilinos::
duplicate_communicator (input_row_map.Comm()));
ExcDimensionMismatch (n_entries_per_row.size(),
input_row_map.NumGlobalElements()));
+ Utilities::Trilinos::destroy_communicator (*communicator);
communicator.reset (Utilities::Trilinos::
duplicate_communicator (input_row_map.Comm()));
ExcDimensionMismatch (sp.n_cols(),
input_col_map.NumGlobalElements()));
+ Utilities::Trilinos::destroy_communicator (*communicator);
communicator.reset (Utilities::Trilinos::
duplicate_communicator (input_row_map.Comm()));
ExcDimensionMismatch (sp.n_cols(),
input_col_map.NumGlobalElements()));
+ Utilities::Trilinos::destroy_communicator (*communicator);
communicator.reset (Utilities::Trilinos::
duplicate_communicator (input_row_map.Comm()));
+ Vector::~Vector ()
+ {
+ Utilities::Trilinos::destroy_communicator (*communicator);
+ }
+
+
+
void
Vector::reinit (const Epetra_Map &input_map,
const bool fast)
{
vector.reset();
+ Utilities::Trilinos::destroy_communicator (*communicator);
communicator.reset (Utilities::Trilinos::
duplicate_communicator(input_map.Comm()));
map = Utilities::Trilinos::duplicate_map (input_map, *communicator);
if (vector->Map().SameAs(v.vector->Map()) == false)
{
vector.reset();
+ Utilities::Trilinos::destroy_communicator (*communicator);
communicator.reset (Utilities::Trilinos::
duplicate_communicator(v.trilinos_vector()
.Map().Comm()));
{
vector.reset();
+ Utilities::Trilinos::destroy_communicator (*communicator);
communicator.reset (Utilities::Trilinos::
duplicate_communicator(v.trilinos_vector().
Map().Comm()));