Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_TpetraCrsMatrixMPVectorUnitTest_Threads.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
13 
15 
16 #include "Kokkos_Core.hpp"
17 #include <Tpetra_KokkosCompat_ClassicNodeAPI_Wrapper.hpp>
18 
19 // Instantiate tests for threads node
20 typedef Tpetra::KokkosCompat::KokkosDeviceWrapperNode<Kokkos::Threads> ThreadsWrapperNode;
22 
23 int main( int argc, char* argv[] ) {
24  Teuchos::GlobalMPISession mpiSession(&argc, &argv);
25 
27 
28  // Initialize threads
29  const size_t num_cores =
30  Kokkos::hwloc::get_available_numa_count() *
31  Kokkos::hwloc::get_available_cores_per_numa();
32  const size_t num_hyper_threads =
33  Kokkos::hwloc::get_available_threads_per_core();
34  // const size_t num_cores = 1;
35  // const size_t num_hyper_threads = 1;
36  Kokkos::InitializationSettings init_args;
37  init_args.set_num_threads(num_cores*num_hyper_threads);
38  Kokkos::initialize( init_args );
39  Kokkos::print_configuration(std::cout);
40 
41  // Run tests
44 
45  // Finish up
46  Kokkos::finalize();
47 
48  return ret;
49 }
#define CRSMATRIX_MP_VECTOR_TESTS_N(N)
static int runUnitTestsFromMain(int argc, char *argv[])
static void setGloballyReduceTestResult(const bool globallyReduceUnitTestResult)
int main(int argc, char **argv)
Tpetra::KokkosCompat::KokkosDeviceWrapperNode< Kokkos::Threads > ThreadsWrapperNode
unsigned global_sacado_mp_vector_size