diff --git a/cmake/Modules/OpenCLLoader.cmake b/cmake/Modules/OpenCLLoader.cmake index 2066b6667e..ea83f8e447 100644 --- a/cmake/Modules/OpenCLLoader.cmake +++ b/cmake/Modules/OpenCLLoader.cmake @@ -1,6 +1,6 @@ message(STATUS "Downloading and building OpenCL loader library") -set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.04.29.tar.gz" CACHE STRING "URL for OpenCL loader tarball") -set(OPENCL_LOADER_MD5 "bd0bcd6c0989bffc24c76c2e0d67d2c6" CACHE STRING "MD5 checksum of OpenCL loader tarball") +set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.05.02.tar.gz" CACHE STRING "URL for OpenCL loader tarball") +set(OPENCL_LOADER_MD5 "29180b05056578afda92f0d394c3a373" CACHE STRING "MD5 checksum of OpenCL loader tarball") mark_as_advanced(OPENCL_LOADER_URL) mark_as_advanced(OPENCL_LOADER_MD5) diff --git a/src/info.cpp b/src/info.cpp index 099a4582dc..512858b9f2 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -39,6 +39,7 @@ #include "pair.h" #include "pair_hybrid.h" #include "region.h" +#include "text_file_reader.h" #include "update.h" #include "variable.h" @@ -1261,7 +1262,25 @@ std::string Info::get_os_info() #else struct utsname ut; uname(&ut); - buf = fmt::format("{} {} on {}", ut.sysname, ut.release, ut.machine); + + // try to get OS distribution name, if available + std::string distro = ut.sysname; + if (utils::file_is_readable("/etc/os-release")) { + try { + TextFileReader reader("/etc/os-release",""); + while (1) { + auto words = reader.next_values(0,"="); + if ((words.count() > 1) && (words.next_string() == "PRETTY_NAME")) { + distro += " " + utils::trim(words.next_string()); + break; + } + } + } catch (std::exception &e) { + ; // EOF but keyword not found + } + } + + buf = fmt::format("{} {} on {}", distro, ut.release, ut.machine); #endif return buf; } diff --git a/unittest/cplusplus/test_lammps_class.cpp b/unittest/cplusplus/test_lammps_class.cpp index 0e9c6aa9ab..04ad403db6 100644 --- a/unittest/cplusplus/test_lammps_class.cpp +++ b/unittest/cplusplus/test_lammps_class.cpp @@ -99,7 +99,6 @@ TEST_F(LAMMPS_plain, InitMembers) EXPECT_STREQ(LAMMPS::git_branch, "(unknown)"); EXPECT_STREQ(LAMMPS::git_descriptor, "(unknown)"); } - EXPECT_EQ(lmp->comm->nthreads, 1); } TEST_F(LAMMPS_plain, TestStyles) @@ -234,9 +233,6 @@ TEST_F(LAMMPS_omp, InitMembers) EXPECT_STREQ(LAMMPS::git_branch, "(unknown)"); EXPECT_STREQ(LAMMPS::git_descriptor, "(unknown)"); } -#if 0 // temporarily disabled. MacOS behaves different from Linux here. - EXPECT_EQ(lmp->comm->nthreads, 2); -#endif } // test fixture for Kokkos tests @@ -326,10 +322,10 @@ TEST_F(LAMMPS_kokkos, InitMembers) } } -// check if Comm::nthreads is initialized to either 1 or 2 (from the previous tests) TEST(LAMMPS_init, OpenMP) { if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP(); + if (Info::get_openmp_info() == "OpenMP not enabled") GTEST_SKIP(); FILE *fp = fopen("in.lammps_empty", "w"); fputs("\n", fp); diff --git a/unittest/force-styles/tests/dihedral-table_cut_linear.yaml b/unittest/force-styles/tests/dihedral-table_cut_linear.yaml index c34c6269de..7b4c429c96 100644 --- a/unittest/force-styles/tests/dihedral-table_cut_linear.yaml +++ b/unittest/force-styles/tests/dihedral-table_cut_linear.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Mar 2021 date_generated: Tue Mar 23 08:05:02 202 -epsilon: 1e-14 +epsilon: 2e-14 prerequisites: ! | atom full dihedral table/cut diff --git a/unittest/force-styles/tests/dihedral-table_cut_spline.yaml b/unittest/force-styles/tests/dihedral-table_cut_spline.yaml index 9148e0a80d..40437ebbbb 100644 --- a/unittest/force-styles/tests/dihedral-table_cut_spline.yaml +++ b/unittest/force-styles/tests/dihedral-table_cut_spline.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Mar 2021 date_generated: Tue Mar 23 08:06:45 202 -epsilon: 1e-14 +epsilon: 2e-14 prerequisites: ! | atom full dihedral table/cut