From: Peter Munch Date: Mon, 13 Apr 2020 09:22:06 +0000 (+0200) Subject: Test more X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef4b26f5c9657563d4dc1a862a9fd79b4c765b48;p=dealii.git Test more --- diff --git a/include/deal.II/lac/la_sm_vector.h b/include/deal.II/lac/la_sm_vector.h index ff4628a28b..12dff8febd 100644 --- a/include/deal.II/lac/la_sm_vector.h +++ b/include/deal.II/lac/la_sm_vector.h @@ -125,6 +125,8 @@ namespace LinearAlgebra Vector(); + Vector(const bool do_ghost_value_update, const bool do_compress); + Vector(const Vector &in_vector); Vector(const size_type size); @@ -495,6 +497,9 @@ namespace LinearAlgebra mutable bool vector_is_ghosted; + bool do_ghost_value_update = true; + bool do_compress = true; + mutable std::mutex mutex; void diff --git a/include/deal.II/lac/la_sm_vector.templates.h b/include/deal.II/lac/la_sm_vector.templates.h index fe30bb8a18..35a67352e8 100644 --- a/include/deal.II/lac/la_sm_vector.templates.h +++ b/include/deal.II/lac/la_sm_vector.templates.h @@ -279,6 +279,17 @@ namespace LinearAlgebra + template + Vector::Vector(const bool do_ghost_value_update, + const bool do_compress) + : partitioner_old(new Utilities::MPI::Partitioner()) + , allocated_size(0) + , do_ghost_value_update(do_ghost_value_update) + , do_compress(do_compress) + {} + + + template Vector::Vector( const Vector &v) @@ -520,10 +531,12 @@ namespace LinearAlgebra ExcNotImplemented()); Assert(vector_is_ghosted == false, ExcMessage("Cannot call compress() on a ghosted vector")); - partitioner->compress_start(data.values.get(), - data.others, - import_data, - communication_channel); + + if (do_compress) + partitioner->compress_start(data.values.get(), + data.others, + import_data, + communication_channel); } @@ -536,7 +549,10 @@ namespace LinearAlgebra Assert(::dealii::VectorOperation::values::add == operation, ExcNotImplemented()); vector_is_ghosted = false; - partitioner->compress_finish(data.values.get(), data.others, import_data); + if (do_compress) + partitioner->compress_finish(data.values.get(), + data.others, + import_data); } @@ -546,10 +562,11 @@ namespace LinearAlgebra Vector::update_ghost_values_start( const unsigned int communication_channel) const { - partitioner->update_ghost_values_start(data.values.get(), - data.others, - import_data, - communication_channel); + if (do_ghost_value_update) + partitioner->update_ghost_values_start(data.values.get(), + data.others, + import_data, + communication_channel); } @@ -558,9 +575,10 @@ namespace LinearAlgebra void Vector::update_ghost_values_finish() const { - partitioner->update_ghost_values_finish(data.values.get(), - data.others, - import_data); + if (do_ghost_value_update) + partitioner->update_ghost_values_finish(data.values.get(), + data.others, + import_data); vector_is_ghosted = true; }