MueLu Version of the Day
Loading...
Searching...
No Matches
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
15#include <Teuchos_ParameterList.hpp>
16
17#include <Xpetra_Export_fwd.hpp>
18#include <Xpetra_Import_fwd.hpp>
19#include <Xpetra_Matrix_fwd.hpp>
20
22
23namespace 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
32template <class Scalar,
35 class Node = DefaultNode>
36class PerfUtils {
37#undef MUELU_PERFUTILS_SHORT
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
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
static bool CheckMatrix(const Matrix &A)
static std::string PrintImporterInfo(RCP< const Import > importer, const std::string &msgTag)
static std::string PrintMatrixInfo(const Matrix &A, const std::string &msgTag, RCP< const Teuchos::ParameterList > params=Teuchos::null)
static std::string CommPattern(const Matrix &A, const std::string &msgTag, RCP< const Teuchos::ParameterList > params=Teuchos::null)
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode