Skip to content

Commit

Permalink
fix trilinos GetComm
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed Nov 28, 2023
1 parent 7cee6d2 commit 9b2c966
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/nvector/nvector_trilinos.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ SUNDIALS_EXPORT N_Vector N_VCloneEmpty_Trilinos(N_Vector w);
SUNDIALS_EXPORT N_Vector N_VClone_Trilinos(N_Vector w);
SUNDIALS_EXPORT void N_VDestroy_Trilinos(N_Vector v);
SUNDIALS_EXPORT void N_VSpace_Trilinos(N_Vector v, sunindextype *lrw, sunindextype *liw);
SUNDIALS_EXPORT MPI_Comm N_VGetCommunicator_Trilinos(N_Vector v);
SUNDIALS_EXPORT SUNComm N_VGetCommunicator_Trilinos(N_Vector v);
SUNDIALS_EXPORT sunindextype N_VGetLength_Trilinos(N_Vector v);
SUNDIALS_EXPORT void N_VLinearSum_Trilinos(sunrealtype a, N_Vector x, sunrealtype b, N_Vector y, N_Vector z);
SUNDIALS_EXPORT void N_VConst_Trilinos(sunrealtype c, N_Vector z);
Expand Down
4 changes: 2 additions & 2 deletions src/nvector/trilinos/nvector_trilinos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ void N_VSpace_Trilinos(N_Vector x, sunindextype *lrw, sunindextype *liw)
/*
* MPI communicator accessor
*/
MPI_Comm N_VGetCommunicator_Trilinos(N_Vector x)
SUNComm N_VGetCommunicator_Trilinos(N_Vector x)
{
#ifdef SUNDIALS_TRILINOS_HAVE_MPI
Teuchos::RCP<const vector_type> xv = N_VGetVector_Trilinos(x);
/* Access Teuchos::Comm* (which is actually a Teuchos::MpiComm*) */
auto comm = Teuchos::rcp_dynamic_cast<const Teuchos::MpiComm<int>>(xv->getMap()->getComm());
return(*(comm->getRawMpiComm().get())); /* extract MPI_Comm */
#else
return(NULL);
return(SUN_COMM_NULL);
#endif
}

Expand Down

0 comments on commit 9b2c966

Please sign in to comment.