]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test more
authorPeter Munch <peterrmuench@gmail.com>
Mon, 13 Apr 2020 09:22:06 +0000 (11:22 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 13 Apr 2020 09:22:06 +0000 (11:22 +0200)
include/deal.II/lac/la_sm_vector.h
include/deal.II/lac/la_sm_vector.templates.h

index ff4628a28b4387936eb6f290292ed9d9ab9a3810..12dff8febd9fb3046f8f45f01c14bc13743f94ce 100644 (file)
@@ -125,6 +125,8 @@ namespace LinearAlgebra
 
       Vector();
 
+      Vector(const bool do_ghost_value_update, const bool do_compress);
+
       Vector(const Vector<Number, MemorySpace> &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
index fe30bb8a1812151237f53d1701806f92426f4898..35a67352e8ad36d2b0fe2d62a9c822f227ccb793 100644 (file)
@@ -279,6 +279,17 @@ namespace LinearAlgebra
 
 
 
+    template <typename Number, typename MemorySpaceType>
+    Vector<Number, MemorySpaceType>::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 <typename Number, typename MemorySpaceType>
     Vector<Number, MemorySpaceType>::Vector(
       const Vector<Number, MemorySpaceType> &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<Number, MemorySpaceType>::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<Number, MemorySpaceType>::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;
     }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.