MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_PerfUtils_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef MUELU_PERFUTILS_DECL_HPP
11 #define MUELU_PERFUTILS_DECL_HPP
12 
13 #include "MueLu_ConfigDefs.hpp"
14 
16 
17 #include <Xpetra_Export_fwd.hpp>
18 #include <Xpetra_Import_fwd.hpp>
19 #include <Xpetra_Matrix_fwd.hpp>
20 
21 #include "MueLu_PerfUtils_fwd.hpp"
22 
23 namespace MueLu {
24 // MPI helpers
25 #define MueLu_sumAll(rcpComm, in, out) \
26  Teuchos::reduceAll(*rcpComm, Teuchos::REDUCE_SUM, in, Teuchos::outArg(out))
27 #define MueLu_minAll(rcpComm, in, out) \
28  Teuchos::reduceAll(*rcpComm, Teuchos::REDUCE_MIN, in, Teuchos::outArg(out))
29 #define MueLu_maxAll(rcpComm, in, out) \
30  Teuchos::reduceAll(*rcpComm, Teuchos::REDUCE_MAX, in, Teuchos::outArg(out))
31 
32 template <class Scalar,
35  class Node = DefaultNode>
36 class PerfUtils {
37 #undef MUELU_PERFUTILS_SHORT
38 #include "MueLu_UseShortNames.hpp"
39 
40  public:
41  static std::string PrintMatrixInfo(const Matrix& A, const std::string& msgTag, RCP<const Teuchos::ParameterList> params = Teuchos::null);
42 
43  static std::string PrintImporterInfo(RCP<const Import> importer, const std::string& msgTag);
44 
45  static std::string CommPattern(const Matrix& A, const std::string& msgTag, RCP<const Teuchos::ParameterList> params = Teuchos::null);
46 
47  private:
48  static bool CheckMatrix(const Matrix& A);
49 };
50 
51 } // namespace MueLu
52 
53 #define MUELU_PERFUTILS_SHORT
54 #endif // MUELU_PERFUTILS_DECL_HPP
static bool CheckMatrix(const Matrix &A)
MueLu::DefaultLocalOrdinal LocalOrdinal
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
MueLu::DefaultNode Node
static std::string CommPattern(const Matrix &A, const std::string &msgTag, RCP< const Teuchos::ParameterList > params=Teuchos::null)
static std::string PrintImporterInfo(RCP< const Import > importer, const std::string &msgTag)
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
static std::string PrintMatrixInfo(const Matrix &A, const std::string &msgTag, RCP< const Teuchos::ParameterList > params=Teuchos::null)