Tpetra parallel linear algebra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
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
10
#include "
Tpetra_Details_isInterComm.hpp
"
11
#include "Teuchos_Comm.hpp"
12
#ifdef HAVE_TPETRACORE_MPI
13
#include "
Tpetra_Details_extractMpiCommFromTeuchos.hpp
"
14
#endif
// HAVE_TPETRACORE_MPI
15
#include <stdexcept>
// std::logic_error
16
17
namespace
Tpetra
{
18
namespace
Details
{
19
20
#ifdef HAVE_TPETRACORE_MPI
21
bool
isInterComm
(
const
Teuchos::Comm<int>& comm) {
22
MPI_Comm rawMpiComm = extractMpiCommFromTeuchos(comm);
23
int
flag = 0;
24
// This is a "local routine" (MPI 3.1, Section 6.6.1, p. 259).
25
(void)MPI_Comm_test_inter(rawMpiComm, &flag);
26
return
flag != 0;
27
}
28
29
#else
// NOT HAVE_TPETRACORE_MPI
30
31
bool
isInterComm
(
const
Teuchos::Comm<int>&
/* comm */
) {
32
return
false
;
33
}
34
#endif
// HAVE_TPETRACORE_MPI
35
36
}
// namespace Details
37
}
// namespace Tpetra
Tpetra_Details_extractMpiCommFromTeuchos.hpp
Declaration of Tpetra::Details::extractMpiCommFromTeuchos.
Tpetra_Details_isInterComm.hpp
Declaration of Tpetra::Details::isInterComm.
Tpetra::Details
Nonmember function that computes a residual Computes R = B - A * X.
Definition
Tpetra_KokkosRefactor_Details_MultiVectorLocalDeepCopy.hpp:17
Tpetra::Details::isInterComm
bool isInterComm(const Teuchos::Comm< int > &)
Return true if and only if the input communicator wraps an MPI intercommunicator.
Definition
Tpetra_Details_isInterComm.cpp:31
Tpetra
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Generated by
1.17.0