From 79d456eca820d9d5027443d96f8df1b641e02948 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sun, 22 Mar 2020 23:49:38 +0100 Subject: [PATCH] Fix compression (zero out ghosts in one go) --- include/deal.II/lac/la_sm_partitioner.h | 11 ++++++----- include/deal.II/lac/la_sm_vector.templates.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/deal.II/lac/la_sm_partitioner.h b/include/deal.II/lac/la_sm_partitioner.h index 2ad2dcea57..2b60c5e4fd 100644 --- a/include/deal.II/lac/la_sm_partitioner.h +++ b/include/deal.II/lac/la_sm_partitioner.h @@ -246,7 +246,7 @@ namespace LinearAlgebra 0, MPI_INT, recv_sm_ranks[i], - communication_channel + 1, + communication_channel + 2, comm_sm, recv_sm_req.data() + i); @@ -255,7 +255,7 @@ namespace LinearAlgebra 0, MPI_INT, send_sm_ranks[i], - communication_channel + 1, + communication_channel + 2, comm_sm, send_sm_req.data() + i); @@ -264,7 +264,7 @@ namespace LinearAlgebra recv_remote_ptr[i + 1] - recv_remote_ptr[i], Utilities::MPI::internal::mpi_type_id(data_this), recv_remote_ranks[i], - communication_channel + 0, + communication_channel + 3, comm, recv_remote_req.data() + i); @@ -279,7 +279,7 @@ namespace LinearAlgebra send_remote_ptr[i + 1] - send_remote_ptr[i], Utilities::MPI::internal::mpi_type_id(data_this), send_remote_ranks[i], - communication_channel + 0, + communication_channel + 3, comm, send_remote_req.data() + i); } @@ -383,7 +383,7 @@ namespace LinearAlgebra &i, MPI_STATUS_IGNORE); - const Number *__restrict__ data_others_ptr = + Number *__restrict__ data_others_ptr = data_others[send_sm_ranks[i]]; Number *__restrict__ data_this_ptr = data_this; @@ -392,6 +392,7 @@ namespace LinearAlgebra j++, k++) { data_this_ptr[send_sm_indices[j]] += data_others_ptr[k]; + data_others_ptr[k] = 0.0; } } diff --git a/include/deal.II/lac/la_sm_vector.templates.h b/include/deal.II/lac/la_sm_vector.templates.h index 18a938eda1..873c6a6488 100644 --- a/include/deal.II/lac/la_sm_vector.templates.h +++ b/include/deal.II/lac/la_sm_vector.templates.h @@ -1030,7 +1030,7 @@ namespace LinearAlgebra typename Vector::real_type Vector::linfty_norm_local() const { - real_type max = 0.; + real_type max = Number(); auto values = this->begin(); -- 2.39.5