From: Timo Heister Date: Mon, 8 Jul 2024 12:24:21 +0000 (-0400) Subject: fix tests/sundial/n_vector.cc for sundials 7 X-Git-Tag: v9.6.0-rc1~123^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17226%2Fhead;p=dealii.git fix tests/sundial/n_vector.cc for sundials 7 it turns out the API made incompatible changes see https://cdash.dealii.org/test/1377355 --- 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"));