From 97930f4e5e8c52844a691a298ce497b8ed4b86d9 Mon Sep 17 00:00:00 2001 From: Irina Tezaur Date: Fri, 23 Dec 2022 12:36:00 -0800 Subject: [PATCH] Attempt to fix build failure described in issue #879. --- src/disc/stk/Albany_STKDiscretization.cpp | 6 +++++- src/landIce/interfaceWithCISM/ali_driver.cpp | 3 ++- src/landIce/interfaceWithMPAS/Interface.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/disc/stk/Albany_STKDiscretization.cpp b/src/disc/stk/Albany_STKDiscretization.cpp index 39bdf9dbc9..44cac505d4 100644 --- a/src/disc/stk/Albany_STKDiscretization.cpp +++ b/src/disc/stk/Albany_STKDiscretization.cpp @@ -2307,8 +2307,12 @@ STKDiscretization::setupExodusOutput() Ioss::Init::Initializer io; + Teuchos::Ptr > mpi_comm = + Teuchos::ptr_dynamic_cast >(Teuchos::ptrFromRef(*comm)); + auto raw_mpi_comm = mpi_comm->getRawMpiComm(); + mesh_data = Teuchos::rcp( - new stk::io::StkMeshIoBroker(getMpiCommFromTeuchosComm(comm))); + new stk::io::StkMeshIoBroker(*raw_mpi_comm)); mesh_data->set_bulk_data(Teuchos::get_shared_ptr(bulkData)); //IKT, 8/16/19: The following is needed to get correct output file for Schwarz problems //Please see: https://github.com/trilinos/Trilinos/issues/5479 diff --git a/src/landIce/interfaceWithCISM/ali_driver.cpp b/src/landIce/interfaceWithCISM/ali_driver.cpp index d3c2e59d57..576b46b254 100644 --- a/src/landIce/interfaceWithCISM/ali_driver.cpp +++ b/src/landIce/interfaceWithCISM/ali_driver.cpp @@ -160,7 +160,8 @@ void ali_driver_init(int /* argc */, int /* exec_mode */, AliToGlimmer * ftg_ptr comm = MPI_Comm_f2c(cism_communicator); //MPI_COMM_size (comm, &cism_process_count); //MPI_COMM_rank (comm, &my_cism_rank); - mpiCommT = Albany::createTeuchosCommFromMpiComm(comm); + //mpiCommT = Albany::createTeuchosCommFromMpiComm(comm); + mpiCommT = Teuchos::rcp(new Teuchos::MpiComm(Teuchos::opaqueWrapper(comm),1984)); //IK, 4/4/14: get verbosity level specified in CISM *.config file debug_output_verbosity = *(ftg_ptr -> getLongVar("debug_output_verbosity","options")); diff --git a/src/landIce/interfaceWithMPAS/Interface.cpp b/src/landIce/interfaceWithMPAS/Interface.cpp index a5649b8071..ce86804da6 100644 --- a/src/landIce/interfaceWithMPAS/Interface.cpp +++ b/src/landIce/interfaceWithMPAS/Interface.cpp @@ -347,7 +347,8 @@ void velocity_solver_export_fo_velocity(MPI_Comm reducedComm) { } int velocity_solver_init_mpi(MPI_Comm comm) { - mpiCommMPAS = Albany::createTeuchosCommFromMpiComm(comm); + //mpiCommMPAS = Albany::createTeuchosCommFromMpiComm(comm); + mpiCommMPAS = Teuchos::rcp(new Teuchos::MpiComm(Teuchos::opaqueWrapper(comm),1984)); if(! Kokkos::is_initialized()) { Kokkos::initialize(); kokkosInitializedByAlbany = true; @@ -398,7 +399,8 @@ void velocity_solver_finalize() { void velocity_solver_compute_2d_grid(MPI_Comm reducedComm) { auto grid2DTimer = Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer("Albany: Compute 2D Grid")); keptMesh = false; - mpiComm = Albany::createTeuchosCommFromMpiComm(reducedComm); + //mpiComm = Albany::createTeuchosCommFromMpiComm(reducedComm); + mpiComm = Teuchos::rcp(new Teuchos::MpiComm(Teuchos::opaqueWrapper(reducedComm),1984)); } void velocity_solver_set_physical_parameters(double const& gravity, double const& ice_density, double const& ocean_density, double const& sea_level, double const& flowParamA, double const& flowLawExponent, double const& dynamic_thickness, bool const& use_GLP, double const& clausiusClapeyoronCoeff) {