From 79dd02fb5fc566ba12dcbb6cd72fc1ddd7d79c09 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Sat, 28 Sep 2024 10:09:20 +0200 Subject: [PATCH 01/12] fix unit test, sort interfaces in comm rank order, clean-up --- src/MatrixWrapper/Distributed.C | 2 +- src/Repartitioner.C | 2 +- unitTests/Repartitioner.C | 533 ++------------------------------ unitTests/Repartitioner.H | 86 ++++++ unitTests/Repartitioner2D.C | 408 ++++++++++++++++++++++++ 5 files changed, 525 insertions(+), 506 deletions(-) create mode 100644 unitTests/Repartitioner.H diff --git a/src/MatrixWrapper/Distributed.C b/src/MatrixWrapper/Distributed.C index 54b3f67a..eb2d39d3 100644 --- a/src/MatrixWrapper/Distributed.C +++ b/src/MatrixWrapper/Distributed.C @@ -124,7 +124,7 @@ void update_fused_impl( label tot_local_matrix_nnz = local_matrix_nnz + n_interfaces; // size + padding has to be local_matrix_nnz - // [upper, lower, diag, interfaces] | [upper, lower, diag, interfaces] + // [upper, lower, diag] | [upper, lower, diag], [interfaces | interfaces] auto diag_comm_pattern = compute_gather_to_owner_counts( exec_handler, ranks_per_gpu, nrows, tot_local_matrix_nnz, local_matrix_nnz - nrows, n_interfaces); diff --git a/src/Repartitioner.C b/src/Repartitioner.C index dcf814b9..3681183a 100644 --- a/src/Repartitioner.C +++ b/src/Repartitioner.C @@ -358,7 +358,7 @@ Repartitioner::build_non_local_interfaces( return comm_target_ids[i] < comm_target_ids[j]; }); - label interface_offset = 0; + label interface_offset = local_spans.back().end; label ctr = 0; label local_ctr =0; label non_local_ctr = 0; diff --git a/unitTests/Repartitioner.C b/unitTests/Repartitioner.C index 7ec97fbf..cb1ada50 100644 --- a/unitTests/Repartitioner.C +++ b/unitTests/Repartitioner.C @@ -2,75 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -#include "OGL/Repartitioner.H" -#include "OGL/common.H" - - -#include "gtest/gtest.h" - -#include "mpi.h" - -#include - -//--------------------------------------------- -// some_header.h -extern int my_argc; -extern char **my_argv; -// eof -//--------------------------------------------- - -//--------------------------------------------- -// main.cpp -int my_argc; -char **my_argv; - -using vec = std::vector