44#if defined(HAVE_TPETRACORE_MPI)
45# include "Teuchos_DefaultMpiComm.hpp"
47# include "Teuchos_Comm.hpp"
53#if defined(HAVE_TPETRACORE_MPI)
56 (void) MPI_Initialized (&isInitialized);
70#if defined(HAVE_TPETRACORE_MPI)
73 (void) MPI_Finalized (&isFinalized);
79 return isFinalized != 0;
85#if defined(HAVE_TPETRACORE_MPI)
86 bool isMpiComm (
const Teuchos::Comm<int>& comm)
88 using mpi_comm_type = Teuchos::MpiComm<int>;
89 return dynamic_cast<const mpi_comm_type*
> (&comm) !=
nullptr;
92 bool isMpiComm (
const Teuchos::Comm<int>& )
98 int getRankHarmlessly (
const Teuchos::Comm<int>& comm)
100 if (mpiIsInitialized () && ! mpiIsFinalized () && isMpiComm (comm)) {
101 return comm.getRank ();
113 const std::string&
s,
114 const Teuchos::Comm<int>* comm)
Declaration of Tpetra::Details::printOnce.
Struct that holds views of the contents of a CrsMatrix.
Implementation details of Tpetra.
void printOnce(std::ostream &out, const std::string &s, const Teuchos::Comm< int > *comm)
Print on one process of the given communicator, or at least try to do so (if MPI is not initialized).
bool mpiIsInitialized()
Has MPI_Init been called (on this process)?
bool mpiIsFinalized()
Has MPI_Finalize been called (on this process)?
Namespace Tpetra contains the class and methods constituting the Tpetra library.
bool isInitialized()
Whether Tpetra is in an initialized state.