From a8ba92054effc4042afda25c3053e456a3563d2d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 7 Dec 2022 22:12:47 +0000 Subject: [PATCH] Indentation --- .../lac/la_parallel_vector.templates.h | 2 +- .../deal.II/lac/read_write_vector.templates.h | 7 +++- source/grid/grid_tools.cc | 2 +- source/particles/particle_handler.cc | 2 +- tests/lac/parallel_vector_01.cc | 2 +- tests/lac/parallel_vector_04.cc | 11 ++++--- tests/lac/parallel_vector_14.cc | 3 +- tests/lac/parallel_vector_16.cc | 25 ++++++++++---- tests/lac/parallel_vector_21.cc | 8 +++-- tests/lac/parallel_vector_22.cc | 33 ++++++++++++------- tests/lac/parallel_vector_23.cc | 4 +-- 11 files changed, 67 insertions(+), 32 deletions(-) diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 3b3beaafbe..a07df612ab 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -482,7 +482,7 @@ namespace LinearAlgebra KOKKOS_LAMBDA(size_type i, RealType & update) { update = Kokkos::max(update, Kokkos::abs(data.values(i))); }, - Kokkos::Max(result)); + Kokkos::Max(result)); } }; } // namespace internal diff --git a/include/deal.II/lac/read_write_vector.templates.h b/include/deal.II/lac/read_write_vector.templates.h index 040ccd4ee2..08135c2d10 100644 --- a/include/deal.II/lac/read_write_vector.templates.h +++ b/include/deal.II/lac/read_write_vector.templates.h @@ -177,7 +177,12 @@ namespace LinearAlgebra const unsigned int n_elements = communication_pattern->locally_owned_size(); - Kokkos::deep_copy(Kokkos::View(tmp_vector.begin(), n_elements), Kokkos::View(values, n_elements)); + Kokkos::deep_copy( + Kokkos::View(tmp_vector.begin(), + n_elements), + Kokkos::View( + values, n_elements)); tmp_vector.update_ghost_values(); const IndexSet &stored = rw_vector.get_stored_elements(); diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 6821c57fe5..9d5da20c39 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -2963,7 +2963,7 @@ namespace GridTools { if (!used_vertices_rtree.empty()) { - Assert(false, ExcInternalError()); + Assert(false, ExcInternalError()); } else { diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index ffa7c14d7a..20f260cc6b 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -1395,7 +1395,7 @@ namespace Particles if (!found_cell) { - Assert(false, ExcInternalError()); + Assert(false, ExcInternalError()); } if (!found_cell) diff --git a/tests/lac/parallel_vector_01.cc b/tests/lac/parallel_vector_01.cc index a0923b67af..60dfbc9f2b 100644 --- a/tests/lac/parallel_vector_01.cc +++ b/tests/lac/parallel_vector_01.cc @@ -84,7 +84,7 @@ main(int argc, char **argv) unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); - + if (myid == 0) { initlog(); diff --git a/tests/lac/parallel_vector_04.cc b/tests/lac/parallel_vector_04.cc index a3ccdb10c3..a3cb093854 100644 --- a/tests/lac/parallel_vector_04.cc +++ b/tests/lac/parallel_vector_04.cc @@ -70,12 +70,15 @@ test() { unsigned int local_index = partitioner->global_to_local(1); double * values_dev = v.get_values(); - Kokkos::deep_copy(Kokkos::View(values_dev+local_index), 7); + Kokkos::deep_copy(Kokkos::View( + values_dev + local_index), + 7); } - unsigned int allocated_size = local_relevant.n_elements(); - Kokkos::View v_device(v.get_values(), allocated_size); - Kokkos::View v_host("v_host", allocated_size); + unsigned int allocated_size = local_relevant.n_elements(); + Kokkos::View v_device( + v.get_values(), allocated_size); + Kokkos::View v_host("v_host", allocated_size); Kokkos::deep_copy(v_host, v_device); AssertThrow(v_host[partitioner->global_to_local(myid * 2)] == myid * 4.0, diff --git a/tests/lac/parallel_vector_14.cc b/tests/lac/parallel_vector_14.cc index fbb594bef1..4ff6f1bbec 100644 --- a/tests/lac/parallel_vector_14.cc +++ b/tests/lac/parallel_vector_14.cc @@ -68,7 +68,8 @@ test() v.import(rw_vector, VectorOperation::insert); - LinearAlgebra::distributed::Vector w(v), u(v); + LinearAlgebra::distributed::Vector w(v), + u(v); u = 0; v *= 2.0; diff --git a/tests/lac/parallel_vector_16.cc b/tests/lac/parallel_vector_16.cc index b59379f967..21e0f5cc23 100644 --- a/tests/lac/parallel_vector_16.cc +++ b/tests/lac/parallel_vector_16.cc @@ -54,15 +54,18 @@ test() LinearAlgebra::distributed::Vector v( local_owned, local_relevant, MPI_COMM_WORLD); - Kokkos::View v_view(v.get_values(), local_relevant.n_elements()); + Kokkos::View v_view( + v.get_values(), local_relevant.n_elements()); - deallog << "Local range of proc 0: " << v.get_partitioner()->local_range().first << " " + deallog << "Local range of proc 0: " + << v.get_partitioner()->local_range().first << " " << v.get_partitioner()->local_range().second << std::endl; // set local values for (types::global_dof_index i = 0; i < local_size; ++i) { - Kokkos::deep_copy(Kokkos::subview(v_view, i), min_index + myid * local_size + i); + Kokkos::deep_copy(Kokkos::subview(v_view, i), + min_index + myid * local_size + i); } deallog << "vector norm: " << v.l2_norm() << std::endl; @@ -74,10 +77,18 @@ test() v.zero_out_ghost_values(); const auto &partitioner = v.get_partitioner(); - Kokkos::deep_copy(Kokkos::subview(v_view, partitioner->global_to_local(min_index + 38)), min_index); - Kokkos::deep_copy(Kokkos::subview(v_view, partitioner->global_to_local(min_index + 39)), min_index*2); - Kokkos::deep_copy(Kokkos::subview(v_view, partitioner->global_to_local(min_index + 41)), min_index+7); - Kokkos::deep_copy(Kokkos::subview(v_view, partitioner->global_to_local(min_index + 42)), -static_cast(min_index)); + Kokkos::deep_copy( + Kokkos::subview(v_view, partitioner->global_to_local(min_index + 38)), + min_index); + Kokkos::deep_copy( + Kokkos::subview(v_view, partitioner->global_to_local(min_index + 39)), + min_index * 2); + Kokkos::deep_copy( + Kokkos::subview(v_view, partitioner->global_to_local(min_index + 41)), + min_index + 7); + Kokkos::deep_copy( + Kokkos::subview(v_view, partitioner->global_to_local(min_index + 42)), + -static_cast(min_index)); v.compress(VectorOperation::add); v.update_ghost_values(); v.print(deallog.get_file_stream(), 12, false, false); diff --git a/tests/lac/parallel_vector_21.cc b/tests/lac/parallel_vector_21.cc index 3a1890530f..ac37704758 100644 --- a/tests/lac/parallel_vector_21.cc +++ b/tests/lac/parallel_vector_21.cc @@ -50,10 +50,14 @@ test() v2.reinit(v, true); // set locally owned range of v2 manually - Kokkos::View v2_view(v2.get_values(), v2.local_size()); + Kokkos::View v2_view( + v2.get_values(), v2.local_size()); Kokkos::deep_copy(v2_view, 1.); - Kokkos::parallel_for(v2.local_size(), KOKKOS_LAMBDA(int i) { KOKKOS_IMPL_DO_NOT_USE_PRINTF("%d: %f\n", i, v2_view(i));}); + Kokkos::parallel_for( + v2.local_size(), KOKKOS_LAMBDA(int i) { + KOKKOS_IMPL_DO_NOT_USE_PRINTF("%d: %f\n", i, v2_view(i)); + }); // add entries to ghost values // Because of limitation in import, the IndexSet of the ReadWriteVector needs // to have the local elements. diff --git a/tests/lac/parallel_vector_22.cc b/tests/lac/parallel_vector_22.cc index 43c2ddb192..1697623d11 100644 --- a/tests/lac/parallel_vector_22.cc +++ b/tests/lac/parallel_vector_22.cc @@ -29,10 +29,10 @@ template double -print_value(Number* values_dev, unsigned int index) +print_value(Number *values_dev, unsigned int index) { static Kokkos::View cpu_value("cpu_value"); - Kokkos::deep_copy(cpu_value, Kokkos::View(values_dev+index)); + Kokkos::deep_copy(cpu_value, Kokkos::View(values_dev + index)); return cpu_value(); } @@ -59,12 +59,17 @@ test() // create vector LinearAlgebra::distributed::Vector v( local_owned, local_relevant, MPI_COMM_WORLD); - Kokkos::View v_device(v.get_values(), local_relevant.n_elements()); + Kokkos::View v_device( + v.get_values(), local_relevant.n_elements()); const auto &partitioner = v.get_partitioner(); // set local values - Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(myid * 2)), myid*2.0); - Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(myid * 2+1)), myid*2.0+1.0); + Kokkos::deep_copy(Kokkos::subview(v_device, + partitioner->global_to_local(myid * 2)), + myid * 2.0); + Kokkos::deep_copy(Kokkos::subview(v_device, + partitioner->global_to_local(myid * 2 + 1)), + myid * 2.0 + 1.0); v.compress(VectorOperation::add); v *= 2.0; @@ -82,8 +87,8 @@ test() // set ghost dof on owning processor and maximize if (myid != 0) Kokkos::deep_copy(Kokkos::subview(v_device, - partitioner->global_to_local(1)), - 7. * myid); + partitioner->global_to_local(1)), + 7. * myid); v.compress(VectorOperation::max); // import ghosts onto all procs @@ -111,7 +116,9 @@ test() // set ghost dof on non-owning processors and minimize v.zero_out_ghost_values(); if (myid == 0) - Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(1)), -1); + Kokkos::deep_copy(Kokkos::subview(v_device, + partitioner->global_to_local(1)), + -1); v.compress(VectorOperation::min); v.update_ghost_values(); @@ -125,7 +132,9 @@ test() v.zero_out_ghost_values(); v = 1.0; if (myid == 0) - Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(1)), -1); + Kokkos::deep_copy(Kokkos::subview(v_device, + partitioner->global_to_local(1)), + -1); // maximize v.compress(VectorOperation::max); @@ -142,7 +151,8 @@ test() // maximum is -1: v.zero_out_ghost_values(); v = 1.0; - Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(1)), -1); + Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(1)), + -1); v.compress(VectorOperation::max); v.update_ghost_values(); deallog << myid << ":" @@ -154,7 +164,8 @@ test() // than zero v.zero_out_ghost_values(); v = -1.0; - Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(1)), -1); + Kokkos::deep_copy(Kokkos::subview(v_device, partitioner->global_to_local(1)), + -1); v.compress(VectorOperation::max); deallog << myid << ":" << "ghost entry after first max: " diff --git a/tests/lac/parallel_vector_23.cc b/tests/lac/parallel_vector_23.cc index 264e2864ad..16bcfa90e6 100644 --- a/tests/lac/parallel_vector_23.cc +++ b/tests/lac/parallel_vector_23.cc @@ -30,10 +30,10 @@ template double -print_value(Number* values_dev, unsigned int index) +print_value(Number *values_dev, unsigned int index) { static Kokkos::View cpu_value("cpu_value"); - Kokkos::deep_copy(cpu_value, Kokkos::View(values_dev+index)); + Kokkos::deep_copy(cpu_value, Kokkos::View(values_dev + index)); return cpu_value(); } -- 2.39.5