Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Teuchos_GlobalMPISession.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_GLOBAL_MPI_SESSION_HPP
11
#define TEUCHOS_GLOBAL_MPI_SESSION_HPP
12
17
18
#include "TeuchosCore_ConfigDefs.hpp"
19
20
#include "Teuchos_ArrayView.hpp"
21
22
23
namespace
Teuchos
{
24
34
//
81
class
TEUCHOSCORE_LIB_DLL_EXPORT
GlobalMPISession
82
{
83
public
:
84
86
87
130
GlobalMPISession
(
int
* argc,
char
*** argv, std::ostream *out = &std::cout );
131
133
~GlobalMPISession
();
134
136
138
139
144
static
void
abort
();
145
147
148
156
static
bool
mpiIsInitialized
();
157
163
static
bool
mpiIsFinalized
();
164
175
static
int
getRank
();
176
187
static
int
getNProc
();
188
197
static
void
barrier
();
198
215
static
int
sum
(
int
localVal);
216
232
static
void
allGather
(
int
localVal,
const
ArrayView<int>
&allVals);
233
234
#ifdef HAVE_TEUCHOSCORE_KOKKOS
242
static
std::vector<std::string> getArgv ();
243
#endif
// HAVE_TEUCHOSCORE_KOKKOS
245
246
private
:
247
248
static
bool
haveMPIState_;
249
static
bool
mpiIsFinalized_;
250
static
int
rank_;
251
static
int
nProc_;
252
#ifdef HAVE_TEUCHOSCORE_KOKKOS
260
static
std::vector<std::string> argvCopy_;
261
#endif
// HAVE_TEUCHOSCORE_KOKKOS
262
263
static
void
initialize( std::ostream *out );
264
265
static
void
justInTimeInitialize();
266
267
};
268
269
}
// namespace Teuchos
270
271
#endif
// TEUCHOS_GLOBAL_MPI_SESSION_HPP
Teuchos::ArrayView
Nonowning array view.
Definition
Teuchos_ArrayViewDecl.hpp:90
Teuchos::GlobalMPISession::sum
static int sum(int localVal)
Sum a set of integers across processes.
Definition
Teuchos_GlobalMPISession.cpp:223
Teuchos::GlobalMPISession::abort
static void abort()
abort the program
Definition
Teuchos_GlobalMPISession.cpp:180
Teuchos::GlobalMPISession::barrier
static void barrier()
Call MPI_Barrier() on MPI_COMM_WORLD.
Definition
Teuchos_GlobalMPISession.cpp:214
Teuchos::GlobalMPISession::getRank
static int getRank()
The rank of the calling process in MPI_COMM_WORLD.
Definition
Teuchos_GlobalMPISession.cpp:201
Teuchos::GlobalMPISession::GlobalMPISession
GlobalMPISession(int *argc, char ***argv, std::ostream *out=&std::cout)
Calls MPI_Init() if MPI is enabled.
Definition
Teuchos_GlobalMPISession.cpp:43
Teuchos::GlobalMPISession::getNProc
static int getNProc()
The number of processes in MPI_COMM_WORLD.
Definition
Teuchos_GlobalMPISession.cpp:208
Teuchos::GlobalMPISession::mpiIsInitialized
static bool mpiIsInitialized()
Return whether MPI was initialized.
Definition
Teuchos_GlobalMPISession.cpp:189
Teuchos::GlobalMPISession::mpiIsFinalized
static bool mpiIsFinalized()
Return whether MPI was already finalized.
Definition
Teuchos_GlobalMPISession.cpp:195
Teuchos::GlobalMPISession::allGather
static void allGather(int localVal, const ArrayView< int > &allVals)
Global all-to-all of a set of integers across processes.
Definition
Teuchos_GlobalMPISession.cpp:236
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0