Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_DefaultMpiComm.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TEUCHOS_MPI_COMM_HPP
11#define TEUCHOS_MPI_COMM_HPP
12
17
19
20// If MPI is not enabled, disable the contents of this file.
21#ifdef HAVE_TEUCHOS_MPI
22
23#include "Teuchos_Comm.hpp"
24#include "Teuchos_CommUtilities.hpp"
26#include "Teuchos_OpaqueWrapper.hpp"
28#include "Teuchos_SerializationTraitsHelpers.hpp"
29#include "Teuchos_Workspace.hpp"
31#include "Teuchos_as.hpp"
32#include "Teuchos_Assert.hpp"
33#include <mpi.h>
34#include <iterator>
35#include "Teuchos_DefaultMpiComm_decl.hpp"
36
37// This must be defined globally for the whole program!
38//#define TEUCHOS_MPI_COMM_DUMP
39
40#ifdef TEUCHOS_MPI_COMM_DUMP
41# include "Teuchos_VerboseObject.hpp"
42#endif
43
44namespace Teuchos {
45
47TEUCHOSCOMM_LIB_DLL_EXPORT std::string
48mpiErrorCodeToString (const int err);
49
50namespace details {
64 TEUCHOSCOMM_LIB_DLL_EXPORT void safeCommFree (MPI_Comm* comm);
65
70 TEUCHOSCOMM_LIB_DLL_EXPORT int setCommErrhandler (MPI_Comm comm, MPI_Errhandler handler);
71
72} // namespace details
73
74#ifdef TEUCHOS_MPI_COMM_DUMP
75template<typename Ordinal, typename T>
76void dumpBuffer(
77 const std::string &funcName, const std::string &buffName
78 ,const Ordinal bytes, const T buff[]
79 )
80{
83 Teuchos::OSTab tab(out);
84 *out
85 << "\n" << funcName << "::" << buffName << ":\n";
86 tab.incrTab();
87 for( Ordinal i = 0; i < bytes; ++i ) {
88 *out << buffName << "[" << i << "] = '" << buff[i] << "'\n";
89 }
90 *out << "\n";
91}
92#endif // TEUCHOS_MPI_COMM_DUMP
93
94}
95
96#endif // HAVE_TEUCHOS_MPI
97#endif // TEUCHOS_MPI_COMM_HPP
98
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Implementation detail of Teuchos' MPI wrapper.
Defines basic traits for the ordinal field type.
Defines basic traits returning the name of a type in a portable and readable way.
Definition of Teuchos::as, for conversions between types.
Smart reference counting pointer class for automatic garbage collection.
static RCP< FancyOStream > getDefaultOStream()
Get the default output stream object.
Tabbing class for helping to create formated, indented output for a basic_FancyOStream object.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Teuchos implementation details.