Skip to content

Commit

Permalink
TrilinosCouplings: Initialize Kokkos in Maxwell Epetra example
Browse files Browse the repository at this point in the history
MueLu RefMaxwell requires Kokkos
  • Loading branch information
cgcgcg committed Sep 1, 2023
1 parent cb7a065 commit 2bb4069
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
37 changes: 21 additions & 16 deletions packages/trilinoscouplings/examples/scaling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,34 @@ IF(${PACKAGE_NAME}_ENABLE_Epetra AND ${PACKAGE_NAME}_ENABLE_EpetraExt AND
NUM_MPI_PROCS 1
)

TRIBITS_ADD_EXECUTABLE(
Example_Maxwell
SOURCES example_Maxwell.cpp
TrilinosCouplings_Pamgen_Utils.cpp
COMM serial mpi

IF(${PACKAGE_NAME}_ENABLE_Kokkos)

TRIBITS_ADD_EXECUTABLE(
Example_Maxwell
SOURCES example_Maxwell.cpp
TrilinosCouplings_Pamgen_Utils.cpp
COMM serial mpi
)

TRIBITS_ADD_TEST(
TRIBITS_ADD_TEST(
Example_Maxwell
NAME Example_Maxwell_ML
ARGS "--solverName=ML"
NUM_MPI_PROCS 1
COMM mpi serial
)
)

IF(${PACKAGE_NAME}_ENABLE_Stratimikos)
TRIBITS_ADD_TEST(
Example_Maxwell
NAME Example_Maxwell_ML_Stratimikos
ARGS "--solverName=ML-Stratimikos"
NUM_MPI_PROCS 1
COMM mpi serial
IF(${PACKAGE_NAME}_ENABLE_Stratimikos)
TRIBITS_ADD_TEST(
Example_Maxwell
NAME Example_Maxwell_ML_Stratimikos
ARGS "--solverName=ML-Stratimikos"
NUM_MPI_PROCS 1
COMM mpi serial
)
ENDIF()

ENDIF()


Expand All @@ -95,7 +100,7 @@ IF(${PACKAGE_NAME}_ENABLE_Epetra AND ${PACKAGE_NAME}_ENABLE_EpetraExt AND
Example_Poisson2D_pn_tpetra
SOURCES example_Poisson2D_pn_tpetra.cpp
TrilinosCouplings_Pamgen_Utils.cpp
TrilinosCouplings_IntrepidPoissonExampleHelpers.cpp
TrilinosCouplings_IntrepidPoissonExampleHelpers.cpp
COMM mpi
)

Expand All @@ -107,7 +112,7 @@ IF(${PACKAGE_NAME}_ENABLE_Epetra AND ${PACKAGE_NAME}_ENABLE_EpetraExt AND
NUM_MPI_PROCS 1
)

IF(MueLu_ENABLE_Epetra)
IF(MueLu_ENABLE_Epetra AND ${PACKAGE_NAME}_ENABLE_Kokkos)
TRIBITS_ADD_TEST(
Example_Maxwell
NAME Example_Maxwell_MueLu
Expand Down
12 changes: 12 additions & 0 deletions packages/trilinoscouplings/examples/scaling/example_Maxwell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
#include "Intrepid_DefaultCubatureFactory.hpp"
#include "Intrepid_Utils.hpp"

// Kokkos includes
#include "Kokkos_Core.hpp"

// Epetra includes
#include "Epetra_Time.h"
#include "Epetra_Map.h"
Expand Down Expand Up @@ -403,7 +406,16 @@ int evalCurlCurlu(double & curlcurlu0,
/**********************************************************************************/
/******************************** MAIN ********************************************/
/**********************************************************************************/
int body(int argc, char *argv[]);

int main(int argc, char *argv[]) {
Kokkos::initialize(argc,argv);
body(argc,argv);
if (!Kokkos::is_finalized())
Kokkos::finalize();
}

int body(int argc, char *argv[]) {
// using namespace TrilinosCouplings;
// using IntrepidPoissonExample::parseCommandLineArguments;
// using IntrepidPoissonExample::setCommandLineArgumentDefaults;
Expand Down

0 comments on commit 2bb4069

Please sign in to comment.