Tpetra parallel linear algebra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Tpetra_Details_mpiIsInitialized.cpp
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
#include "Tpetra_Details_mpiIsInitialized.hpp"
11
#ifdef HAVE_TPETRACORE_MPI
12
#include "mpi.h"
13
#include <iostream>
14
#endif
// HAVE_TPETRACORE_MPI
15
16
namespace
Tpetra
{
17
namespace
Details
{
18
19
bool
mpiIsInitialized
() {
20
#ifdef HAVE_TPETRACORE_MPI
21
int
isInitialized
= 0;
22
const
int
errCode = MPI_Initialized(&
isInitialized
);
23
// If the call failed, then assume MPI wasn't implemented
24
// correctly and return false.
25
return
errCode == MPI_SUCCESS && (
isInitialized
!= 0);
26
#else
27
return
false
;
// Tpetra was not built with MPI support
28
#endif
// HAVE_TPETRACORE_MPI
29
}
30
31
bool
mpiIsFinalized
() {
32
#ifdef HAVE_TPETRACORE_MPI
33
int
isFinalized = 0;
34
const
int
errCode = MPI_Finalized(&isFinalized);
35
// If the call failed, then assume MPI wasn't implemented
36
// correctly and return false.
37
return
errCode == MPI_SUCCESS && (isFinalized != 0);
38
#else
39
return
false
;
// Tpetra was not built with MPI support
40
#endif
// HAVE_TPETRACORE_MPI
41
}
42
43
}
// namespace Details
44
}
// namespace Tpetra
Tpetra::Details
Nonmember function that computes a residual Computes R = B - A * X.
Definition
Tpetra_KokkosRefactor_Details_MultiVectorLocalDeepCopy.hpp:17
Tpetra::Details::mpiIsInitialized
bool mpiIsInitialized()
Has MPI_Init been called (on this process)?
Definition
Tpetra_Details_mpiIsInitialized.cpp:19
Tpetra::Details::mpiIsFinalized
bool mpiIsFinalized()
Has MPI_Finalize been called (on this process)?
Definition
Tpetra_Details_mpiIsInitialized.cpp:31
Tpetra
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Tpetra::isInitialized
bool isInitialized()
Whether Tpetra is in an initialized state.
Definition
Tpetra_Core.cpp:166
Generated by
1.17.0