From 1c3af58dbacbe903992553cfafacf4dcf3b75741 Mon Sep 17 00:00:00 2001 From: Mikael Simberg Date: Mon, 4 Sep 2023 17:48:41 +0200 Subject: [PATCH] Replace thread_manager::wait with pika::wait --- CMakeLists.txt | 2 +- ci/.gitlab-ci.yml | 2 +- include/dlaf/eigensolver/reduction_to_band/impl.h | 3 ++- spack/packages/dla-future/package.py | 1 + .../eigensolver/test_eigensolver_correctness.h | 4 +++- test/src/gtest_mpipika_main.cpp | 3 +-- test/unit/eigensolver/test_bt_band_to_tridiag.cpp | 10 ++++++---- test/unit/eigensolver/test_bt_reduction_to_band.cpp | 6 +++--- test/unit/eigensolver/test_gen_eigensolver.cpp | 4 +++- test/unit/eigensolver/test_gen_to_std.cpp | 6 +++--- test/unit/eigensolver/test_reduction_to_band.cpp | 4 ++-- .../eigensolver/test_tridiag_solver_distributed.cpp | 10 +++++----- test/unit/factorization/test_cholesky.cpp | 6 +++--- test/unit/matrix/test_matrix.cpp | 3 ++- .../multiplication/test_multiplication_general.cpp | 6 ++++-- .../multiplication/test_multiplication_hermitian.cpp | 6 +++--- .../multiplication/test_multiplication_triangular.cpp | 6 +++--- .../permutations/test_permutations_distributed.cpp | 6 +++--- test/unit/solver/test_triangular.cpp | 6 +++--- 19 files changed, 52 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1ad8735fe..d22e13b9cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,7 @@ else() endif() # ----- pika -find_package(pika 0.15.1 REQUIRED) +find_package(pika 0.17.0 REQUIRED) find_package(pika-algorithms 0.1.1 REQUIRED) # ----- BLASPP/LAPACKPP diff --git a/ci/.gitlab-ci.yml b/ci/.gitlab-ci.yml index ca8f3ed597..5a76fe5049 100644 --- a/ci/.gitlab-ci.yml +++ b/ci/.gitlab-ci.yml @@ -17,7 +17,7 @@ stages: timeout: 6 hours variables: GIT_SUBMODULE_STRATEGY: recursive - SPACK_SHA: b313b28e64c15761be0d45a16c922c25b2786f76 + SPACK_SHA: 566754440f9dfed9accd25db7f1a67b0cd074fcd SPACK_DLAF_REPO: ./spack before_script: - !reference [.fetch-registry-tokens, script] diff --git a/include/dlaf/eigensolver/reduction_to_band/impl.h b/include/dlaf/eigensolver/reduction_to_band/impl.h index 0974ac4a6a..d3114b620f 100644 --- a/include/dlaf/eigensolver/reduction_to_band/impl.h +++ b/include/dlaf/eigensolver/reduction_to_band/impl.h @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -1088,7 +1089,7 @@ Matrix ReductionToBand::call(comm::CommunicatorGrid gri // Note: // This is a temporary workaround. // See issue https://github.com/eth-cscs/DLA-Future/issues/729 - pika::threads::get_thread_manager().wait(); + pika::wait(); common::Pipeline mpi_col_chain_panel(grid.colCommunicator().clone()); common::Pipeline mpi_row_chain(grid.rowCommunicator().clone()); diff --git a/spack/packages/dla-future/package.py b/spack/packages/dla-future/package.py index 555d870c40..e6fc2563ee 100644 --- a/spack/packages/dla-future/package.py +++ b/spack/packages/dla-future/package.py @@ -56,6 +56,7 @@ class DlaFuture(CMakePackage, CudaPackage, ROCmPackage): depends_on("pika@0.15.1:", when="@0.1") depends_on("pika@0.16:", when="@0.2.0:") + depends_on("pika@0.17:", when="@master") depends_on("pika-algorithms@0.1:") depends_on("pika +mpi") depends_on("pika +cuda", when="+cuda") diff --git a/test/include/dlaf_test/eigensolver/test_eigensolver_correctness.h b/test/include/dlaf_test/eigensolver/test_eigensolver_correctness.h index 4b53b8805c..071aaf3113 100644 --- a/test/include/dlaf_test/eigensolver/test_eigensolver_correctness.h +++ b/test/include/dlaf_test/eigensolver/test_eigensolver_correctness.h @@ -15,6 +15,8 @@ #include +#include + #include #include #include @@ -42,7 +44,7 @@ void testEigensolverCorrectness(const blas::Uplo uplo, Matrix #include -#include #include @@ -89,7 +88,7 @@ GTEST_API_ int main(int argc, char** argv) { protected: virtual void OnTestEnd(const ::testing::TestInfo& test_info) override { - pika::threads::get_thread_manager().wait(); + pika::wait(); MPIListener::OnTestEnd(test_info); } }; diff --git a/test/unit/eigensolver/test_bt_band_to_tridiag.cpp b/test/unit/eigensolver/test_bt_band_to_tridiag.cpp index 97521de2b4..268dba1e04 100644 --- a/test/unit/eigensolver/test_bt_band_to_tridiag.cpp +++ b/test/unit/eigensolver/test_bt_band_to_tridiag.cpp @@ -8,6 +8,8 @@ // SPDX-License-Identifier: BSD-3-Clause // +#include + #include #include #include // for nrSweeps/nrStepsForSweep @@ -267,7 +269,7 @@ TYPED_TEST(BacktransformationBandToTridiagTestMC, CorrectnessDistributed) { for (const auto& [m, n, mb, nb, group_size, b] : configs) { getTuneParameters().bt_band_to_tridiag_hh_apply_group_size = group_size; testBacktransformation(comm_grid, m, n, mb, nb, b); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -285,7 +287,7 @@ TYPED_TEST(BacktransformationBandToTridiagTestGPU, CorrectnessDistributed) { for (const auto& [m, n, mb, nb, group_size, b] : configs) { getTuneParameters().bt_band_to_tridiag_hh_apply_group_size = group_size; testBacktransformation(comm_grid, m, n, mb, nb, b); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -308,7 +310,7 @@ TYPED_TEST(BacktransformationBandToTridiagTestMC, CorrectnessDistributedSubBand) for (const auto& [m, n, mb, nb, group_size, b] : configs_subband) { getTuneParameters().bt_band_to_tridiag_hh_apply_group_size = group_size; testBacktransformation(comm_grid, m, n, mb, nb, b); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -326,7 +328,7 @@ TYPED_TEST(BacktransformationBandToTridiagTestGPU, CorrectnessDistributedSubBand for (const auto& [m, n, mb, nb, group_size, b] : configs_subband) { getTuneParameters().bt_band_to_tridiag_hh_apply_group_size = group_size; testBacktransformation(comm_grid, m, n, mb, nb, b); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/eigensolver/test_bt_reduction_to_band.cpp b/test/unit/eigensolver/test_bt_reduction_to_band.cpp index 84db4b25a1..3cd4378e9f 100644 --- a/test/unit/eigensolver/test_bt_reduction_to_band.cpp +++ b/test/unit/eigensolver/test_bt_reduction_to_band.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include @@ -253,7 +253,7 @@ TYPED_TEST(BackTransformationReductionToBandEigenSolverTestMC, CorrectnessDistri for (const auto& [m, n, mb, nb, b] : sizes) { testBackTransformationReductionToBand(comm_grid, m, n, mb, nb, b); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -264,7 +264,7 @@ TYPED_TEST(BackTransformationReductionToBandEigenSolverTestGPU, CorrectnessDistr for (const auto& [m, n, mb, nb, b] : sizes) { testBackTransformationReductionToBand(comm_grid, m, n, mb, nb, b); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/eigensolver/test_gen_eigensolver.cpp b/test/unit/eigensolver/test_gen_eigensolver.cpp index 3fcf98b37b..c4f6997f79 100644 --- a/test/unit/eigensolver/test_gen_eigensolver.cpp +++ b/test/unit/eigensolver/test_gen_eigensolver.cpp @@ -11,6 +11,8 @@ #include #include +#include + #include #include #include @@ -73,7 +75,7 @@ void testGenEigensolverCorrectness(const blas::Uplo uplo, Matrix #include -#include +#include #include #include @@ -124,7 +124,7 @@ TYPED_TEST(EigensolverGenToStdTestMC, CorrectnessDistributed) { for (const auto uplo : blas_uplos) { for (const auto& [m, mb] : sizes) { testGenToStdEigensolver(comm_grid, uplo, m, mb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -144,7 +144,7 @@ TYPED_TEST(EigensolverGenToStdTestGPU, CorrectnessDistributed) { for (const auto uplo : blas_uplos) { for (const auto& [m, mb] : sizes) { testGenToStdEigensolver(comm_grid, uplo, m, mb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/eigensolver/test_reduction_to_band.cpp b/test/unit/eigensolver/test_reduction_to_band.cpp index 59ea0021e1..fd7b02685c 100644 --- a/test/unit/eigensolver/test_reduction_to_band.cpp +++ b/test/unit/eigensolver/test_reduction_to_band.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -405,7 +405,7 @@ void testReductionToBand(comm::CommunicatorGrid grid, const LocalElementSize siz checkUpperPartUnchanged(reference, matrix_a_h); // Wait for all work to finish before doing blocking communication - pika::threads::get_thread_manager().wait(); + pika::wait(); auto mat_v = allGather(blas::Uplo::Lower, matrix_a_h, grid); auto mat_b = makeLocal(matrix_a_h); diff --git a/test/unit/eigensolver/test_tridiag_solver_distributed.cpp b/test/unit/eigensolver/test_tridiag_solver_distributed.cpp index 38909c1aa8..78b8a1e440 100644 --- a/test/unit/eigensolver/test_tridiag_solver_distributed.cpp +++ b/test/unit/eigensolver/test_tridiag_solver_distributed.cpp @@ -8,7 +8,7 @@ // SPDX-License-Identifier: BSD-3-Clause // -#include +#include #include #include @@ -251,7 +251,7 @@ TYPED_TEST(TridiagSolverDistTestMC, Laplace1D) { for (const auto& comm_grid : this->commGrids()) { for (auto [n, nb] : tested_problems) { solveDistributedLaplace1D(comm_grid, n, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -260,7 +260,7 @@ TYPED_TEST(TridiagSolverDistTestMC, Random) { for (const auto& comm_grid : this->commGrids()) { for (auto [n, nb] : tested_problems) { solveRandomTridiagMatrix(comm_grid, n, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -270,7 +270,7 @@ TYPED_TEST(TridiagSolverDistTestGPU, Laplace1D) { for (const auto& comm_grid : this->commGrids()) { for (auto [n, nb] : tested_problems) { solveDistributedLaplace1D(comm_grid, n, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -279,7 +279,7 @@ TYPED_TEST(TridiagSolverDistTestGPU, Random) { for (const auto& comm_grid : this->commGrids()) { for (auto [n, nb] : tested_problems) { solveRandomTridiagMatrix(comm_grid, n, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/factorization/test_cholesky.cpp b/test/unit/factorization/test_cholesky.cpp index 6232b5d857..9ad9e90169 100644 --- a/test/unit/factorization/test_cholesky.cpp +++ b/test/unit/factorization/test_cholesky.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -111,7 +111,7 @@ TYPED_TEST(CholeskyTestMC, CorrectnessDistributed) { for (auto uplo : blas_uplos) { for (const auto& [m, mb] : sizes) { testCholesky(comm_grid, uplo, m, mb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -131,7 +131,7 @@ TYPED_TEST(CholeskyTestGPU, CorrectnessDistributed) { for (auto uplo : blas_uplos) { for (const auto& [m, mb] : sizes) { testCholesky(comm_grid, uplo, m, mb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/matrix/test_matrix.cpp b/test/unit/matrix/test_matrix.cpp index 917ada9614..16381a889d 100644 --- a/test/unit/matrix/test_matrix.cpp +++ b/test/unit/matrix/test_matrix.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -1892,7 +1893,7 @@ void testReshuffling(const TestReshuffling& config, CommunicatorGrid grid) { // Note: ensure that everything finishes before next call to Communicator::clone() that might block a // working thread (and if it is just one, it would deadlock) - pika::threads::get_thread_manager().wait(); + pika::wait(); } TYPED_TEST(MatrixTest, CopyReshuffling) { diff --git a/test/unit/multiplication/test_multiplication_general.cpp b/test/unit/multiplication/test_multiplication_general.cpp index a2bbf2beea..ea13870301 100644 --- a/test/unit/multiplication/test_multiplication_general.cpp +++ b/test/unit/multiplication/test_multiplication_general.cpp @@ -8,6 +8,8 @@ // SPDX-License-Identifier: BSD-3-Clause // +#include + #include #include #include @@ -172,7 +174,7 @@ TYPED_TEST(GeneralSubMultiplicationDistTestMC, CorrectnessDistributed) { const TypeParam beta = TypeUtilities::element(-2.6, .7); testGeneralSubMultiplication(comm_grid, a, b, alpha, beta, m, mb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -185,7 +187,7 @@ TYPED_TEST(GeneralSubMultiplicationDistTestGPU, CorrectnessDistributed) { const TypeParam beta = TypeUtilities::element(-2.6, .7); testGeneralSubMultiplication(comm_grid, a, b, alpha, beta, m, mb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/multiplication/test_multiplication_hermitian.cpp b/test/unit/multiplication/test_multiplication_hermitian.cpp index 21bce8ebe7..955696405e 100644 --- a/test/unit/multiplication/test_multiplication_hermitian.cpp +++ b/test/unit/multiplication/test_multiplication_hermitian.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -175,7 +175,7 @@ TYPED_TEST(HermitianMultiplicationTestMC, CorrectnessDistributed) { testHermitianMultiplication(comm_grid, side, uplo, m, n, mb, nb, alpha, beta); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -212,7 +212,7 @@ TYPED_TEST(HermitianMultiplicationTestGPU, CorrectnessDistributed) { testHermitianMultiplication(comm_grid, side, uplo, m, n, mb, nb, alpha, beta); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/multiplication/test_multiplication_triangular.cpp b/test/unit/multiplication/test_multiplication_triangular.cpp index 43d1c1555a..e9f3a628e4 100644 --- a/test/unit/multiplication/test_multiplication_triangular.cpp +++ b/test/unit/multiplication/test_multiplication_triangular.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -172,7 +172,7 @@ TYPED_TEST(TriangularMultiplicationTestMC, CorrectnessDistributed) { testTriangularMultiplication(comm_grid, side, uplo, op, diag, alpha, m, n, mb, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -213,7 +213,7 @@ TYPED_TEST(TriangularMultiplicationTestGPU, CorrectnessDistributed) { testTriangularMultiplication(comm_grid, side, uplo, op, diag, alpha, m, n, mb, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/permutations/test_permutations_distributed.cpp b/test/unit/permutations/test_permutations_distributed.cpp index 283d2bc1c5..2e1a8c08fd 100644 --- a/test/unit/permutations/test_permutations_distributed.cpp +++ b/test/unit/permutations/test_permutations_distributed.cpp @@ -10,7 +10,7 @@ #include -#include +#include #include #include @@ -163,7 +163,7 @@ TYPED_TEST(PermutationsDistTestMC, Columns) { for (const auto& comm_grid : this->commGrids()) { for (const auto& [n, nb, i_begin, i_end, perms] : params) { testDistPermutations(comm_grid, n, nb, i_begin, i_end, perms); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -172,7 +172,7 @@ TYPED_TEST(PermutationsDistTestMC, Rows) { for (const auto& comm_grid : this->commGrids()) { for (const auto& [n, nb, i_begin, i_end, perms] : params) { testDistPermutations(comm_grid, n, nb, i_begin, i_end, perms); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } diff --git a/test/unit/solver/test_triangular.cpp b/test/unit/solver/test_triangular.cpp index f226ea8499..6170c87136 100644 --- a/test/unit/solver/test_triangular.cpp +++ b/test/unit/solver/test_triangular.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -165,7 +165,7 @@ TYPED_TEST(TriangularSolverTestMC, CorrectnessDistributed) { TypeParam alpha = TypeUtilities::element(-1.2, .7); testTriangularSolver(comm_grid, side, uplo, op, diag, alpha, m, n, mb, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } } @@ -203,7 +203,7 @@ TYPED_TEST(TriangularSolverTestGPU, CorrectnessDistributed) { testTriangularSolver(comm_grid, side, uplo, op, diag, alpha, m, n, mb, nb); - pika::threads::get_thread_manager().wait(); + pika::wait(); } } }