run KOKKOS force style unit tests with serial when OpenMP is not available
This commit is contained in:
@ -550,7 +550,10 @@ TEST(AngleStyle, kokkos_omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "serial") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -559,6 +562,8 @@ TEST(AngleStyle, kokkos_omp)
|
||||
|
||||
LAMMPS::argv args = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-k", "on", "t", "4", "-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) args[9] = "1";
|
||||
|
||||
::testing::internal::CaptureStdout();
|
||||
LAMMPS *lmp = nullptr;
|
||||
|
||||
@ -553,7 +553,10 @@ TEST(BondStyle, kokkos_omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "serial") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -562,6 +565,8 @@ TEST(BondStyle, kokkos_omp)
|
||||
|
||||
LAMMPS::argv args = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-k", "on", "t", "4", "-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) args[9] = "1";
|
||||
|
||||
::testing::internal::CaptureStdout();
|
||||
LAMMPS *lmp = nullptr;
|
||||
|
||||
@ -569,7 +569,10 @@ TEST(DihedralStyle, kokkos_omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "serial") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -579,6 +582,8 @@ TEST(DihedralStyle, kokkos_omp)
|
||||
LAMMPS::argv args = {"DihedralStyle", "-log", "none", "-echo", "screen",
|
||||
"-nocite", "-k", "on", "t", "4",
|
||||
"-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) args[9] = "1";
|
||||
|
||||
::testing::internal::CaptureStdout();
|
||||
LAMMPS *lmp = nullptr;
|
||||
|
||||
@ -894,7 +894,10 @@ TEST(FixTimestep, kokkos_omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "serial") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -903,6 +906,8 @@ TEST(FixTimestep, kokkos_omp)
|
||||
}
|
||||
LAMMPS::argv args = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-k", "on", "t", "4", "-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) args[9] = "1";
|
||||
|
||||
::testing::internal::CaptureStdout();
|
||||
LAMMPS *lmp = nullptr;
|
||||
|
||||
@ -547,6 +547,10 @@ TEST(ImproperStyle, kokkos_omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "serial") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -556,6 +560,8 @@ TEST(ImproperStyle, kokkos_omp)
|
||||
LAMMPS::argv args = {"ImproperStyle", "-log", "none", "-echo", "screen",
|
||||
"-nocite", "-k", "on", "t", "4",
|
||||
"-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) args[9] = "1";
|
||||
|
||||
::testing::internal::CaptureStdout();
|
||||
LAMMPS *lmp = nullptr;
|
||||
|
||||
@ -114,10 +114,14 @@ TEST(MliapUnified, VersusLJMeltGhost)
|
||||
lammps_close(ljmelt);
|
||||
lammps_close(mliap);
|
||||
}
|
||||
|
||||
TEST(MliapUnified, VersusLJMeltKokkos)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "serial") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -127,6 +131,8 @@ TEST(MliapUnified, VersusLJMeltKokkos)
|
||||
|
||||
const char *lmpargv[] = {"melt", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-k", "on", "t", "4", "-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) lmpargv[9] = "1";
|
||||
int lmpargc = sizeof(lmpargv) / sizeof(const char *);
|
||||
|
||||
void *ljmelt = lammps_open_no_mpi(lmpargc, (char **)lmpargv, nullptr);
|
||||
@ -159,10 +165,14 @@ TEST(MliapUnified, VersusLJMeltKokkos)
|
||||
lammps_close(ljmelt);
|
||||
lammps_close(mliap);
|
||||
}
|
||||
|
||||
TEST(MliapUnified, VersusLJMeltGhostKokkos)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "serial"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -172,6 +182,9 @@ TEST(MliapUnified, VersusLJMeltGhostKokkos)
|
||||
|
||||
const char *lmpargv[] = {"melt", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-k", "on", "t", "4", "-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) lmpargv[9] = "1";
|
||||
|
||||
int lmpargc = sizeof(lmpargv) / sizeof(const char *);
|
||||
|
||||
void *ljmelt = lammps_open_no_mpi(lmpargc, (char **)lmpargv, nullptr);
|
||||
|
||||
@ -650,7 +650,10 @@ TEST(PairStyle, kokkos_omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||
// test either OpenMP or Serial
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "serial") &&
|
||||
!Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
|
||||
GTEST_SKIP();
|
||||
// if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only.
|
||||
if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
|
||||
Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
|
||||
@ -660,6 +663,8 @@ TEST(PairStyle, kokkos_omp)
|
||||
|
||||
LAMMPS::argv args = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-k", "on", "t", "4", "-sf", "kk"};
|
||||
// fall back to serial if openmp is not available
|
||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) args[9] = "1";
|
||||
|
||||
// cannot run dpd styles in plain or hybrid with more than 1 thread due to using multiple pRNGs
|
||||
if (utils::strmatch(test_config.pair_style, "^dpd") ||
|
||||
|
||||
Reference in New Issue
Block a user