]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix SolverCG for sm-mode L:d:V 11151/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 6 Nov 2020 09:29:27 +0000 (10:29 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 6 Nov 2020 19:10:41 +0000 (20:10 +0100)
include/deal.II/lac/la_parallel_vector.templates.h

index 24a1864fa7daae5abd3caff69088007b87e6ae94..235e2d98211e8117fbe81aa1a00638f6dc1af7e8 100644 (file)
@@ -134,27 +134,15 @@ namespace LinearAlgebra
         {
           if (comm_shared == MPI_COMM_SELF)
             {
-              if (new_alloc_size > allocated_size)
-                {
-                  Assert(((allocated_size > 0 && data.values != nullptr) ||
-                          data.values == nullptr),
-                         ExcInternalError());
+              Number *new_val;
+              Utilities::System::posix_memalign(
+                reinterpret_cast<void **>(&new_val),
+                64,
+                sizeof(Number) * new_alloc_size);
+              data.values = {new_val, [](Number *data) { std::free(data); }};
 
-                  Number *new_val;
-                  Utilities::System::posix_memalign(
-                    reinterpret_cast<void **>(&new_val),
-                    64,
-                    sizeof(Number) * new_alloc_size);
-                  data.values = {new_val,
-                                 [](Number *data) { std::free(data); }};
+              allocated_size = new_alloc_size;
 
-                  allocated_size = new_alloc_size;
-                }
-              else if (new_alloc_size == 0)
-                {
-                  data.values.reset();
-                  allocated_size = 0;
-                }
               data.values_sm = {
                 ArrayView<const Number>(data.values.get(), new_alloc_size)};
             }

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.