18#if defined(HAVE_TEUCHOS_KOKKOS_PROFILING) && defined(HAVE_TEUCHOSCORE_KOKKOSCORE)
19#include "Kokkos_Core.hpp"
32 const int myRank = Teuchos::rank(*comm);
34 if ((myRank == 1) || (myRank == 2)) {
46 out <<
"\n### Printing default report ###" << std::endl;
52 timer.
report(out, comm, options);
54 std::ostringstream os;
55 timer.
report(os, comm, options);
57 TEST_ASSERT(os.str().find(
"min=1, max=2, proc min=1, proc max=2") != std::string::npos);
58 TEST_ASSERT(os.str().find(
"<1, 1>") != std::string::npos);
59 TEST_ASSERT(os.str().find(
"min=0, max=3, proc min=0, proc max=3") != std::string::npos);
69int main(
int argc,
char* argv[] )
74#if defined(HAVE_TEUCHOS_KOKKOS_PROFILING) && defined(HAVE_TEUCHOSCORE_KOKKOSCORE)
75 Kokkos::initialize(argc,argv);
84#if defined(HAVE_TEUCHOS_KOKKOS_PROFILING) && defined(HAVE_TEUCHOSCORE_KOKKOSCORE)
85 if (Kokkos::is_initialized())
A MPI utilities class, providing methods for initializing, finalizing, and querying the global MPI se...
#define TEST_ASSERT(v1)
Assert the given statement is true.
Scope guard for Teuchos::Time, with MPI collective timer reporting.
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
the basic timer used elsewhere, uses MPI_Wtime for time
static Teuchos::RCP< const Comm< OrdinalType > > getComm()
Return the default global communicator.
Initialize, finalize, and query the global MPI session.
Concrete serial communicator subclass.
virtual int getSize() const
This class allows one to push and pop timers on and off a stack.
void start(const std::string name, const bool push_kokkos_profiling_region=true)
void stop(const std::string &name, const bool pop_kokkos_profiling_region=true)
const BaseTimer * findBaseTimer(const std::string &name) const
void report(std::ostream &os)
static int runUnitTestsFromMain(int argc, char *argv[])
Run the unit tests from main() passing in (argc, argv).
static void setGloballyReduceTestResult(const bool globallyReduceUnitTestResult)
Set if the unit tests should reduce pass/fail across processes.
std::ostream subclass that performs the magic of indenting data sent to an std::ostream object among ...
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
Set the stream to print only on the (MPI) process with the given rank.