From e9ada2831436140e714b88665305697763b96a37 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 8 Jul 2024 08:24:21 -0400 Subject: [PATCH] fix tests/sundial/n_vector.cc for sundials 7 it turns out the API made incompatible changes see https://cdash.dealii.org/test/1377355 --- tests/sundials/n_vector.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/sundials/n_vector.cc b/tests/sundials/n_vector.cc index a55bdb061b..5aa5de9bac 100644 --- a/tests/sundials/n_vector.cc +++ b/tests/sundials/n_vector.cc @@ -380,9 +380,15 @@ test_get_communicator() // MPI_CONGRUENT indicates same group but different context (e.g. tags, // keyvals, etc.) #ifdef DEAL_II_WITH_MPI - int result; - auto comm = static_cast(N_VGetCommunicator(n_vector)); - MPI_Comm_compare(*comm, MPI_COMM_WORLD, &result); + +# if DEAL_II_SUNDIALS_VERSION_GTE(7, 0, 0) + MPI_Comm comm = N_VGetCommunicator(n_vector); +# else + MPI_Comm comm = *static_cast(N_VGetCommunicator(n_vector)); +# endif + + int result; + MPI_Comm_compare(comm, MPI_COMM_WORLD, &result); Assert(result == MPI_IDENT || result == MPI_CONGRUENT, NVectorTestError()); #endif @@ -1099,7 +1105,10 @@ main(int argc, char **argv) { Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); MPILogInitAll log_all; -#if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0) +#if DEAL_II_SUNDIALS_VERSION_GTE(7, 0, 0) + const int ierr = SUNContext_Create(MPI_COMM_WORLD, &global_nvector_context); + AssertThrow(ierr == 0, ExcMessage("unable to create SUNContext object")); +#elif DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0) MPI_Comm communicator = MPI_COMM_WORLD; const int ierr = SUNContext_Create(&communicator, &global_nvector_context); AssertThrow(ierr == 0, ExcMessage("unable to create SUNContext object")); -- 2.39.5