File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 15
15
// @HEADER
16
16
17
17
#include " KokkosComm_include_mpi.hpp"
18
+ #include " KokkosComm.hpp"
18
19
19
20
#include < Kokkos_Core.hpp>
20
21
#include < benchmark/benchmark.h>
@@ -32,15 +33,12 @@ class NullReporter : public ::benchmark::BenchmarkReporter {
32
33
// The main is rewritten to allow for MPI initializing and for selecting a
33
34
// reporter according to the process rank
34
35
int main (int argc, char **argv) {
35
- MPI_Init (&argc, &argv);
36
-
37
- int rank;
38
- MPI_Comm_rank (MPI_COMM_WORLD, &rank);
39
-
40
- Kokkos::initialize ();
36
+ KokkosComm::initialize (argc, &argv);
41
37
42
38
::benchmark::Initialize (&argc, argv);
43
39
40
+ int rank;
41
+ MPI_Comm_rank (MPI_COMM_WORLD, &rank);
44
42
if (rank == 0 )
45
43
// root process will use a reporter from the usual set provided by
46
44
// ::benchmark
@@ -51,7 +49,6 @@ int main(int argc, char **argv) {
51
49
::benchmark::RunSpecifiedBenchmarks (&null);
52
50
}
53
51
54
- Kokkos::finalize ();
55
- MPI_Finalize ();
52
+ KokkosComm::finalize ();
56
53
return 0 ;
57
- }
54
+ }
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ int main(int argc, char *argv[]) {
81
81
// Intialize google test
82
82
::testing::InitGoogleTest (&argc, argv);
83
83
84
- MPI_Init (&argc, &argv);
84
+ KokkosComm::initialize (argc, &argv);
85
+
85
86
int rank, size;
86
87
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
87
88
MPI_Comm_size (MPI_COMM_WORLD, &size);
@@ -90,8 +91,6 @@ int main(int argc, char *argv[]) {
90
91
<< KOKKOSCOMM_VERSION_PATCH << " )\n " ;
91
92
}
92
93
93
- Kokkos::initialize ();
94
-
95
94
// Intialize google test
96
95
::testing::InitGoogleTest (&argc, argv);
97
96
@@ -105,9 +104,8 @@ int main(int argc, char *argv[]) {
105
104
// run tests
106
105
auto exit_code = RUN_ALL_TESTS ();
107
106
108
- // Finalize MPI before exiting
109
- Kokkos::finalize ();
110
- MPI_Finalize ();
107
+ // Finalize KokkosComm before exiting
108
+ KokkosComm::finalize ();
111
109
112
110
return exit_code;
113
111
}
You can’t perform that action at this time.
0 commit comments