Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_Core.hpp
Go to the documentation of this file.
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 #ifndef TPETRA_CORE_HPP
11 #define TPETRA_CORE_HPP
12 
21 
22 #include <Tpetra_ConfigDefs.hpp>
23 #include <Teuchos_Comm.hpp>
24 #ifdef HAVE_TPETRACORE_MPI
25 #include "mpi.h"
26 #endif // HAVE_TPETRACORE_MPI
27 
28 namespace Tpetra {
29 
39 Teuchos::RCP<const Teuchos::Comm<int> > getDefaultComm();
40 
47 bool isInitialized();
48 
74 void initialize(int* argc, char*** argv);
75 
76 #ifdef HAVE_TPETRA_MPI
77 void initialize(int* argc, char*** argv, MPI_Comm comm);
103 #endif // HAVE_TPETRA_MPI
104 
134 void initialize(int* argc, char*** argv,
135  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
136 
147 void finalize();
148 
188 class ScopeGuard {
189  public:
197  ScopeGuard(int* argc, char*** argv);
198 
199 #ifdef HAVE_TPETRA_MPI
200  ScopeGuard(int* argc, char*** argv, MPI_Comm comm);
212 #endif // HAVE_TPETRA_MPI
213 
218  ScopeGuard() = delete;
219 
225  ~ScopeGuard();
226 };
227 
228 } // namespace Tpetra
229 
230 #endif // TPETRA_CORE_HPP
~ScopeGuard()
Finalize Tpetra.
bool isInitialized()
Whether Tpetra is in an initialized state.
void initialize(int *argc, char ***argv)
Initialize Tpetra.
Scope guard whose destructor automatically calls Tpetra::finalize for you.
void finalize()
Finalize Tpetra.
Teuchos::RCP< const Teuchos::Comm< int > > getDefaultComm()
Get Tpetra&#39;s default communicator.
ScopeGuard()=delete
Default constructor (FORBIDDEN)