18#ifdef DEAL_II_WITH_TRILINOS
19# ifdef DEAL_II_WITH_MPI
20# include <Epetra_MpiComm.h>
21# include <Teuchos_DefaultComm.hpp>
23# include <Epetra_SerialComm.h>
24# include <Teuchos_RCP.hpp>
31#ifdef DEAL_II_WITH_TRILINOS
37# ifdef DEAL_II_WITH_MPI
38 static Teuchos::RCP<Epetra_MpiComm> communicator =
39 Teuchos::rcp(
new Epetra_MpiComm(MPI_COMM_WORLD),
true);
41 static Teuchos::RCP<Epetra_SerialComm> communicator =
42 Teuchos::rcp(
new Epetra_SerialComm(),
true);
50 const Teuchos::RCP<const Teuchos::Comm<int>> &
53# ifdef DEAL_II_WITH_MPI
54 static auto communicator = Teuchos::RCP<const Teuchos::Comm<int>>(
55 new Teuchos::MpiComm<int>(MPI_COMM_SELF));
57 static auto communicator =
58 Teuchos::RCP<const Teuchos::Comm<int>>(
new Teuchos::Comm<int>());
69# ifdef DEAL_II_WITH_MPI
70 static Teuchos::RCP<Epetra_MpiComm> communicator =
71 Teuchos::rcp(
new Epetra_MpiComm(MPI_COMM_SELF),
true);
73 static Teuchos::RCP<Epetra_SerialComm> communicator =
74 Teuchos::rcp(
new Epetra_SerialComm(),
true);
85# ifdef DEAL_II_WITH_MPI
90 const Epetra_MpiComm *mpi_comm =
91 dynamic_cast<const Epetra_MpiComm *
>(&communicator);
92 if (mpi_comm !=
nullptr)
93 return new Epetra_MpiComm(
101 Assert(
dynamic_cast<const Epetra_SerialComm *
>(&communicator) !=
nullptr,
103 return new Epetra_SerialComm(
104 dynamic_cast<const Epetra_SerialComm &
>(communicator));
114# ifdef DEAL_II_WITH_MPI
115 Epetra_MpiComm *mpi_comm =
dynamic_cast<Epetra_MpiComm *
>(&communicator);
116 if (mpi_comm !=
nullptr)
119 *mpi_comm = Epetra_MpiComm(MPI_COMM_SELF);
131 return mpi_communicator.NumProc();
138 return static_cast<unsigned int>(mpi_communicator.MyPID());
146 if (map.LinearMap() ==
true)
153 return Epetra_Map(map.NumGlobalElements(),
162 return Epetra_Map(map.NumGlobalElements(),
164 map.MyGlobalElements(),
173#ifdef DEAL_II_TRILINOS_WITH_TPETRA
178 const Teuchos::RCP<
const Teuchos::Comm<int>> &teuchos_comm)
181# ifdef DEAL_II_WITH_MPI
183 const Teuchos::MpiComm<int> *mpi_comm =
184 dynamic_cast<const Teuchos::MpiComm<int> *
>(teuchos_comm.get());
188 out = *(mpi_comm->getRawMpiComm())();
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
MPI_Comm duplicate_communicator(const MPI_Comm mpi_communicator)
void free_communicator(MPI_Comm mpi_communicator)
void destroy_communicator(Epetra_Comm &communicator)
Epetra_Map duplicate_map(const Epetra_BlockMap &map, const Epetra_Comm &comm)
unsigned int get_this_mpi_process(const Epetra_Comm &mpi_communicator)
unsigned int get_n_mpi_processes(const Epetra_Comm &mpi_communicator)
const Epetra_Comm & comm_self()
MPI_Comm teuchos_comm_to_mpi_comm(const Teuchos::RCP< const Teuchos::Comm< int > > &teuchos_comm)
const Teuchos::RCP< const Teuchos::Comm< int > > & tpetra_comm_self()
Epetra_Comm * duplicate_communicator(const Epetra_Comm &communicator)
const Epetra_Comm & comm_world()