run KOKKOS force style unit tests with serial when OpenMP is not available
This commit is contained in:
@ -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") ||
|
||||
@ -854,8 +859,8 @@ TEST(PairStyle, gpu)
|
||||
epsilon *= 5.0e8;
|
||||
else
|
||||
epsilon *= 1.0e10;
|
||||
// relax test precision when using pppm and single precision FFTs, but only when also
|
||||
// running with double precision
|
||||
// relax test precision when using pppm and single precision FFTs, but only when also
|
||||
// running with double precision
|
||||
#if defined(FFT_SINGLE)
|
||||
if (lmp->force->kspace && lmp->force->kspace->compute_flag &&
|
||||
Info::has_accelerator_feature("GPU", "precision", "double"))
|
||||
|
||||
Reference in New Issue
Block a user