]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix ArborX tests for Trilinos 14/Kokkos 4 15391/head
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 20 Jun 2023 17:52:12 +0000 (13:52 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 20 Jun 2023 18:10:13 +0000 (14:10 -0400)
source/base/kokkos.cc
tests/arborx/distributed_tree_intersect.cc
tests/arborx/distributed_tree_nearest.cc
tests/arborx/point_intersect.cc
tests/arborx/point_nearest.cc
tests/arborx/sphere_intersect.cc
tests/arborx/sphere_nearest.cc

index 66cfaef7b5327546d945238b40bd9d86863a0755..6380fad4ec7545c8a049487f4d936dcc65863005 100644 (file)
@@ -30,7 +30,11 @@ namespace internal
   void
   ensure_kokkos_initialized()
   {
-    if (!Kokkos::is_initialized())
+    if (!Kokkos::is_initialized()
+#if KOKKOS_VERSION >= 30700
+        && !Kokkos::is_finalized()
+#endif
+    )
       {
         // only execute once
         static bool dummy = [] {
index e388b5490ff3738a4e81d8da8d4c7506f6aab299..b3ec93a610a643dbc18c5eaea6b572cbf45dcb48 100644 (file)
@@ -187,8 +187,6 @@ test_3d()
 int
 main(int argc, char **argv)
 {
-  // Initialize Kokkos
-  Kokkos::initialize(argc, argv);
   Utilities::MPI::MPI_InitFinalize mpi_init(argc, argv);
 
   initlog();
@@ -196,6 +194,4 @@ main(int argc, char **argv)
   // tests
   test_2d();
   test_3d();
-
-  Kokkos::finalize();
 }
index b234451be13bc0a24789180043aa120b9dd1a37c..7919abbbeacb8c7b7f9d543a2e833547f51d187e 100644 (file)
@@ -323,8 +323,6 @@ test_point_3d()
 int
 main(int argc, char **argv)
 {
-  // Initialize Kokkos
-  Kokkos::initialize(argc, argv);
   Utilities::MPI::MPI_InitFinalize mpi_init(argc, argv);
 
   initlog();
@@ -334,6 +332,4 @@ main(int argc, char **argv)
   test_bounding_box_3d();
   test_point_2d();
   test_point_3d();
-
-  Kokkos::finalize();
 }
index ca972f7bb6d72fac65d8d229ae9039641585bbb9..e0ff970f26eccb39d5687d077e4d61782c3a51e2 100644 (file)
@@ -170,9 +170,6 @@ test_3d()
 int
 main(int argc, char **argv)
 {
-  // Initialize Kokkos
-  Kokkos::initialize(argc, argv);
-
   initlog();
 
   // Initialize ArborX
@@ -181,6 +178,4 @@ main(int argc, char **argv)
   // tests
   test_2d();
   test_3d();
-
-  Kokkos::finalize();
 }
index 1e9af5ee6e112dfd012816ae93069461a954e9de..31e89f5bc9f64fb4b9db866a565b7eea62af144f 100644 (file)
@@ -283,9 +283,6 @@ test_points_3d()
 int
 main(int argc, char **argv)
 {
-  // Initialize Kokkos
-  Kokkos::initialize(argc, argv);
-
   initlog();
 
   // Initialize ArborX
@@ -296,6 +293,4 @@ main(int argc, char **argv)
   test_bounding_box_3d();
   test_points_2d();
   test_points_3d();
-
-  Kokkos::finalize();
 }
index 7c6d11b665d93fab290a8f9f64881ce7f80eb2cb..a9a807d18db71903a9134a902fd761cc9d972f0c 100644 (file)
@@ -144,9 +144,6 @@ test_3d()
 int
 main(int argc, char **argv)
 {
-  // Initialize Kokkos
-  Kokkos::initialize(argc, argv);
-
   initlog();
 
   // Initialize ArborX
@@ -155,6 +152,4 @@ main(int argc, char **argv)
   // tests
   test_2d();
   test_3d();
-
-  Kokkos::finalize();
 }
index 700d201f3dfa9e2eee092faf5ee23363b98310f9..dae5af87c394018343da529ea20f4e3a04b32a77 100644 (file)
@@ -143,9 +143,6 @@ test_3d()
 int
 main(int argc, char **argv)
 {
-  // Initialize Kokkos
-  Kokkos::initialize(argc, argv);
-
   initlog();
 
   // Initialize ArborX
@@ -154,6 +151,4 @@ main(int argc, char **argv)
   // tests
   test_2d();
   test_3d();
-
-  Kokkos::finalize();
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.