Xpetra
Version of the Day
Loading...
Searching...
No Matches
Xpetra_MpiPlatform.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Xpetra: A linear algebra interface package
4
//
5
// Copyright 2012 NTESS and the Xpetra contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef XPETRA_MPIPLATFORM_HPP
11
#define XPETRA_MPIPLATFORM_HPP
12
13
#include <
Teuchos_DefaultMpiComm.hpp
>
14
#include <Teuchos_Describable.hpp>
15
#include <Tpetra_KokkosCompat_DefaultNode.hpp>
16
17
#include "
Xpetra_ConfigDefs.hpp
"
18
19
namespace
Xpetra
{
20
22
27
template
<
class
Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
28
class
MpiPlatform
:
public
Teuchos::Describable
{
29
public
:
31
typedef
Node
NodeType
;
33
34
36
explicit
MpiPlatform
(
Teuchos::RCP<Node>
node);
37
39
MpiPlatform
(
Teuchos::RCP<Node>
node,
const
Teuchos::RCP
<
const
Teuchos::OpaqueWrapper<MPI_Comm>
> &rawMpiComm);
40
42
~MpiPlatform
();
43
45
47
48
50
Teuchos::RCP<const Teuchos::Comm<int>
>
getComm
()
const
;
51
53
54
private
:
55
Teuchos::RCP<Teuchos::MpiComm<int>
>
comm_
;
56
MpiPlatform
(
const
MpiPlatform<Node>
&platform);
57
};
58
59
template
<
class
Node>
60
MpiPlatform<Node>::MpiPlatform
(
Teuchos::RCP<Node>
/* node */
,
const
Teuchos::RCP
<
const
Teuchos::OpaqueWrapper<MPI_Comm>
> &rawMpiComm)
61
: comm_(
Teuchos
::createMpiComm<int>(rawMpiComm)) {}
62
63
template
<
class
Node>
64
MpiPlatform<Node>::MpiPlatform
(
Teuchos::RCP<Node>
/* node */
)
65
: comm_(
Teuchos
::createMpiComm<int>(
Teuchos
::opaqueWrapper<MPI_Comm>(MPI_COMM_WORLD))) {}
// CHECK: ALLOW MPI_COMM_WORLD
66
67
template
<
class
Node>
68
MpiPlatform<Node>::~MpiPlatform
() {}
69
70
template
<
class
Node>
71
MpiPlatform<Node>::MpiPlatform
(
const
MpiPlatform<Node>
&platform) {
72
comm_ = platform.
comm_
;
73
}
74
75
template
<
class
Node>
76
Teuchos::RCP<const Teuchos::Comm<int>
>
77
MpiPlatform<Node>::getComm
()
const
{
78
return
comm_;
79
}
80
81
}
// namespace Xpetra
82
83
#endif
// XPETRA_MPIPLATFORM_HPP
Teuchos_DefaultMpiComm.hpp
Xpetra_ConfigDefs.hpp
Teuchos::Describable
Teuchos::OpaqueWrapper
Teuchos::RCP
Xpetra::MpiPlatform
A implementation of the Platform class for MPI-based platforms.
Definition
Xpetra_MpiPlatform.hpp:28
Xpetra::MpiPlatform::~MpiPlatform
~MpiPlatform()
Destructor.
Definition
Xpetra_MpiPlatform.hpp:68
Xpetra::MpiPlatform::NodeType
Node NodeType
Typedef indicating the node type over which the platform is templated. This default to the Kokkos def...
Definition
Xpetra_MpiPlatform.hpp:31
Xpetra::MpiPlatform::MpiPlatform
MpiPlatform(Teuchos::RCP< Node > node)
Constructor.
Definition
Xpetra_MpiPlatform.hpp:64
Xpetra::MpiPlatform::comm_
Teuchos::RCP< Teuchos::MpiComm< int > > comm_
Definition
Xpetra_MpiPlatform.hpp:55
Xpetra::MpiPlatform::getComm
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Comm Instance.
Definition
Xpetra_MpiPlatform.hpp:77
Teuchos
Xpetra
Xpetra namespace
Definition
Xpetra_BlockedCrsMatrix_decl.hpp:52
src
Platform
Xpetra_MpiPlatform.hpp
Generated by
1.9.8