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
135  initialize (int* argc, char*** argv,
136  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
137 
148  void finalize ();
149 
189  class ScopeGuard {
190  public:
198  ScopeGuard (int* argc, char*** argv);
199 
200 #ifdef HAVE_TPETRA_MPI
201  ScopeGuard (int* argc, char*** argv, MPI_Comm comm);
213 #endif // HAVE_TPETRA_MPI
214 
219  ScopeGuard () = delete;
220 
226  ~ScopeGuard ();
227  };
228 
229 } // namespace Tpetra
230 
231 #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)