Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_Details_isInterComm.cpp
1// @HEADER
2// *****************************************************************************
3// Tpetra: Templated Linear Algebra Services Package
4//
5// Copyright 2008 NTESS and the Tpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
11#include "Teuchos_Comm.hpp"
12#ifdef HAVE_TPETRACORE_MPI
14#endif // HAVE_TPETRACORE_MPI
15#include <stdexcept> // std::logic_error
16
17namespace Tpetra {
18namespace Details {
19
20#ifdef HAVE_TPETRACORE_MPI
21bool
22isInterComm (const Teuchos::Comm<int>& comm)
23{
24 MPI_Comm rawMpiComm = extractMpiCommFromTeuchos (comm);
25 int flag = 0;
26 // This is a "local routine" (MPI 3.1, Section 6.6.1, p. 259).
27 (void) MPI_Comm_test_inter (rawMpiComm, &flag);
28 return flag != 0;
29}
30
31#else // NOT HAVE_TPETRACORE_MPI
32
33bool
34isInterComm (const Teuchos::Comm<int>& /* comm */ )
35{
36 return false;
37}
38#endif // HAVE_TPETRACORE_MPI
39
40} // namespace Details
41} // namespace Tpetra
42
Declaration of Tpetra::Details::extractMpiCommFromTeuchos.
Declaration of Tpetra::Details::isInterComm.
Nonmember function that computes a residual Computes R = B - A * X.
bool isInterComm(const Teuchos::Comm< int > &)
Return true if and only if the input communicator wraps an MPI intercommunicator.
Namespace Tpetra contains the class and methods constituting the Tpetra library.