forked from lijiext/lammps
Merge branch 'master' into viscosity
This commit is contained in:
commit
5062d57ccb
|
@ -160,9 +160,6 @@ else()
|
|||
enable_language(C)
|
||||
file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c)
|
||||
add_library(mpi_stubs STATIC ${MPI_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE})
|
||||
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps/mpi>)
|
||||
install(FILES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/mpi)
|
||||
|
@ -249,9 +246,6 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE)
|
|||
enable_language(Fortran)
|
||||
file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
|
||||
add_library(linalg STATIC ${LAPACK_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS linalg EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE})
|
||||
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||
|
@ -411,9 +405,6 @@ foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD)
|
|||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
||||
add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${PKG_LIB} EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
set_target_properties(${PKG_LIB} PROPERTIES OUTPUT_NAME lammps_${PKG_LIB}${LAMMPS_MACHINE})
|
||||
target_link_libraries(lammps PRIVATE ${PKG_LIB})
|
||||
if(PKG_LIB STREQUAL awpmd)
|
||||
|
@ -520,14 +511,15 @@ endif()
|
|||
|
||||
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
||||
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
|
||||
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER})
|
||||
add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER})
|
||||
add_dependencies(lammps ${_HEADER})
|
||||
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
||||
endif()
|
||||
endforeach()
|
||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
||||
add_library(LAMMPS::lammps ALIAS lammps)
|
||||
|
@ -536,15 +528,18 @@ set(LAMMPS_API_DEFINES)
|
|||
foreach(_DEF ${LAMMPS_DEFINES})
|
||||
set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -D${_DEF}")
|
||||
endforeach()
|
||||
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
file(GLOB MODULE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Modules/Find*.cmake)
|
||||
install(FILES ${MODULE_FILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY)
|
||||
write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
file(GLOB MODULE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Modules/Find*.cmake)
|
||||
install(FILES ${MODULE_FILES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY)
|
||||
write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS)
|
||||
endif()
|
||||
install(FILES ${LAMMPS_DOC_DIR}/lammps.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME ${LAMMPS_BINARY}.1)
|
||||
|
||||
if(BUILD_TOOLS)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
include(CMakeFindDependencyMacro)
|
||||
if(@BUILD_MPI@)
|
||||
find_dependency(MPI REQUIRED CXX)
|
||||
|
@ -8,80 +8,4 @@ if(@PKG_KSPACE@)
|
|||
find_dependency(@FFTW@ REQUIRED MODULE)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT @BUILD_SHARED_LIBS@)
|
||||
if(@BUILD_OMP@)
|
||||
find_dependency(OpenMP REQUIRED)
|
||||
endif()
|
||||
if(@WITH_JPEG@)
|
||||
find_dependency(JPEG REQUIRED)
|
||||
endif()
|
||||
if(@WITH_PNG@)
|
||||
find_dependency(PNG REQUIRED)
|
||||
find_dependency(ZLIB REQUIRED)
|
||||
endif()
|
||||
if(@PKG_KIM@)
|
||||
find_dependency(PkgConfig REQUIRED)
|
||||
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=@KIM-API_MIN_VERSION@)
|
||||
if(@CURL_FOUND@)
|
||||
find_dependency(CURL REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_USER-SMD@)
|
||||
find_dependency(Eigen3 NO_MODULE REQUIRED)
|
||||
endif()
|
||||
if(@PKG_USER-SCAFACOS@)
|
||||
find_dependency(PkgConfig REQUIRED)
|
||||
find_ependency(GSL REQUIRED)
|
||||
find_dependency(MPI REQUIRED C Fortran)
|
||||
pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos)
|
||||
endif()
|
||||
if(@PKG_PYTHON@ AND NOT CMAKE_VERSION VERSION_LESS 3.12)
|
||||
find_package(Python REQUIRED COMPONENTS Development)
|
||||
endif()
|
||||
if(@PKG_COMPRESS@)
|
||||
find_dependency(ZLIB REQUIRED)
|
||||
endif()
|
||||
if(@PKG_KOKKOS@)
|
||||
if(@EXTERNAL_KOKKOS@)
|
||||
find_dependency(Kokkos 3 REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_VORONOI@)
|
||||
find_dependency(VORO REQUIRED)
|
||||
endif()
|
||||
if(@PKG_USER-INTEL@)
|
||||
if(@INTEL_LRT_MODE@ STREQUAL "THREADS")
|
||||
find_dependency(Threads REQUIRED)
|
||||
endif()
|
||||
if(@TBB_MALLOC_FOUND@)
|
||||
find_ependency(TBB_MALLOC REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_USER-ADIOS@)
|
||||
find_ependency(ADIOS2 REQUIRED)
|
||||
endif()
|
||||
if(@PKG_LATTE@)
|
||||
find_ependency(LATTE REQUIRED)
|
||||
endif()
|
||||
if(@PKG_MESSAGE@)
|
||||
if(@MESSAGE_ZMQ@)
|
||||
find_ependency(ZMQ REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_MSCG@)
|
||||
find_ependency(GSL REQUIRED)
|
||||
find_ependency(MSCG REQUIRED)
|
||||
endif()
|
||||
if(@USER-NETCDF@)
|
||||
if(@NETCDF_FOUND@)
|
||||
find_ependency(NetCDF REQUIRED)
|
||||
endif()
|
||||
if(@PNETCDF_FOUND@)
|
||||
find_ependency(PNetCDF REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if(@PKG_QUIP@)
|
||||
find_ependency(QUIP REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/LAMMPS_Targets.cmake")
|
||||
|
|
|
@ -365,9 +365,6 @@ if(NOT BUILD_MPI)
|
|||
else()
|
||||
target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
|
||||
endif()
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS gpu EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE})
|
||||
target_sources(lammps PRIVATE ${GPU_SOURCES})
|
||||
|
|
|
@ -56,9 +56,6 @@ if(DOWNLOAD_KIM)
|
|||
INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/kim-api")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KIM)
|
||||
add_dependencies(LAMMPS::KIM kim_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION})
|
||||
|
|
|
@ -49,9 +49,6 @@ if(DOWNLOAD_KOKKOS)
|
|||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS)
|
||||
add_dependencies(LAMMPS::KOKKOS kokkos_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
elseif(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos 3.1)
|
||||
if(NOT Kokkos_FOUND)
|
||||
|
|
|
@ -34,9 +34,6 @@ if(DOWNLOAD_LATTE)
|
|||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::LATTE)
|
||||
add_dependencies(LAMMPS::LATTE latte_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(LATTE)
|
||||
if(NOT LATTE_FOUND)
|
||||
|
|
|
@ -7,9 +7,6 @@ file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F
|
|||
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp)
|
||||
|
||||
add_library(cslib STATIC ${cslib_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS cslib EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(cslib PROPERTIES OUTPUT_NAME lammps_cslib${LAMMPS_MACHINE})
|
||||
if(BUILD_MPI)
|
||||
|
|
|
@ -35,9 +35,6 @@ if(DOWNLOAD_MSCG)
|
|||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::MSCG)
|
||||
add_dependencies(LAMMPS::MSCG mscg_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(MSCG)
|
||||
if(NOT MSCG_FOUND)
|
||||
|
|
|
@ -9,9 +9,6 @@ if(COLVARS_LEPTON)
|
|||
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
||||
file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp)
|
||||
add_library(lepton STATIC ${LEPTON_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS lepton EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
# Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
|
||||
target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
|
||||
set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_MACHINE})
|
||||
|
@ -19,9 +16,6 @@ if(COLVARS_LEPTON)
|
|||
endif()
|
||||
|
||||
add_library(colvars STATIC ${COLVARS_SOURCES})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS colvars EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
target_compile_definitions(colvars PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||
set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACHINE})
|
||||
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers")
|
||||
add_library(molfile INTERFACE)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS molfile EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
|
||||
# no need to link with -ldl on windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
|
|
|
@ -70,9 +70,6 @@ if(DOWNLOAD_PLUMED)
|
|||
ExternalProject_get_property(plumed_build INSTALL_DIR)
|
||||
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
||||
add_dependencies(LAMMPS::PLUMED plumed_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
if(PLUMED_MODE STREQUAL "STATIC")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
enable_language(C)
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
message(WARNING "It is recommended to use BUILD_SHARED_LIBS=yes with USER-QMMM")
|
||||
endif()
|
||||
add_library(qmmm STATIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm/libqmmm.c)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS qmmm EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
set_target_properties(qmmm PROPERTIES OUTPUT_NAME lammps_qmmm${LAMMPS_MACHINE})
|
||||
target_link_libraries(lammps PRIVATE qmmm)
|
||||
target_include_directories(qmmm PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm)
|
||||
|
|
|
@ -52,9 +52,6 @@ if(DOWNLOAD_SCAFACOS)
|
|||
INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libfcs.a;${INSTALL_DIR}/lib/libfcs_direct.a;${INSTALL_DIR}/lib/libfcs_ewald.a;${INSTALL_DIR}/lib/libfcs_fmm.a;${INSTALL_DIR}/lib/libfcs_p2nfft.a;${INSTALL_DIR}/lib/libfcs_p3m.a;GSL::gsl;${INSTALL_DIR}/lib/libfcs_near.a;${INSTALL_DIR}/lib/libfcs_gridsort.a;${INSTALL_DIR}/lib/libfcs_resort.a;${INSTALL_DIR}/lib/libfcs_redist.a;${INSTALL_DIR}/lib/libfcs_common.a;${INSTALL_DIR}/lib/libfcs_pnfft.a;${INSTALL_DIR}/lib/libfcs_pfft.a;${INSTALL_DIR}/lib/libfcs_fftw3_mpi.a;${INSTALL_DIR}/lib/libfcs_fftw3.a;MPI::MPI_Fortran;MPI::MPI_C")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::SCAFACOS)
|
||||
add_dependencies(LAMMPS::SCAFACOS scafacos_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos)
|
||||
|
|
|
@ -18,9 +18,6 @@ if(DOWNLOAD_EIGEN3)
|
|||
set_target_properties(LAMMPS::EIGEN3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::EIGEN3)
|
||||
add_dependencies(LAMMPS::EIGEN3 Eigen3_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(Eigen3 NO_MODULE)
|
||||
mark_as_advanced(Eigen3_DIR)
|
||||
|
|
|
@ -35,9 +35,6 @@ if(DOWNLOAD_VORO)
|
|||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::VORO)
|
||||
add_dependencies(LAMMPS::VORO voro_build)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")")
|
||||
endif()
|
||||
else()
|
||||
find_package(VORO)
|
||||
if(NOT VORO_FOUND)
|
||||
|
|
|
@ -87,7 +87,7 @@ KOKKOS, o = USER-OMP, t = OPT.
|
|||
* :doc:`msd/chunk <compute_msd_chunk>`
|
||||
* :doc:`msd/nongauss <compute_msd_nongauss>`
|
||||
* :doc:`omega/chunk <compute_omega_chunk>`
|
||||
* :doc:`orientorder/atom <compute_orientorder_atom>`
|
||||
* :doc:`orientorder/atom (k) <compute_orientorder_atom>`
|
||||
* :doc:`pair <compute_pair>`
|
||||
* :doc:`pair/local <compute_pair_local>`
|
||||
* :doc:`pe <compute_pe>`
|
||||
|
|
|
@ -378,9 +378,9 @@ change some variables later with additional *-D* flags. A few examples:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -C ../cmake/preset/minimal.cmake -D PKG_MISC=on ../cmake
|
||||
cmake -C ../cmake/preset/clang.cmake -C ../cmake/preset/most.cmake ../cmake
|
||||
cmake -C ../cmake/preset/minimal.cmake -D BUILD_MPI=off ../cmake
|
||||
cmake -C ../cmake/presets/minimal.cmake -D PKG_MISC=on ../cmake
|
||||
cmake -C ../cmake/presets/clang.cmake -C ../cmake/presets/most.cmake ../cmake
|
||||
cmake -C ../cmake/presets/minimal.cmake -D BUILD_MPI=off ../cmake
|
||||
|
||||
The first command will install the packages ``KSPACE``, ``MANYBODY``,
|
||||
``MOLECULE``, ``RIGID`` and ``MISC``; the first four from the preset
|
||||
|
@ -396,7 +396,7 @@ It is also possible to do this incrementally.
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -C ../cmake/preset/minimal.cmake ../cmake
|
||||
cmake -C ../cmake/presets/minimal.cmake ../cmake
|
||||
cmake -D PKG_MISC=on .
|
||||
|
||||
will achieve the same configuration like in the first example above. In
|
||||
|
|
|
@ -24,12 +24,13 @@ allows you to install LAMMPS with a single command, and stay
|
|||
up-to-date with the current version of LAMMPS by simply updating your
|
||||
operating system.
|
||||
|
||||
To install the appropriate personal-package archive (PPA), do the
|
||||
To install the appropriate personal-package archives (PPAs), do the
|
||||
following once:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo add-apt-repository ppa:gladky-anton/lammps
|
||||
$ sudo add-apt-repository ppa:openkim/latest
|
||||
$ sudo apt-get update
|
||||
|
||||
To install LAMMPS do the following once:
|
||||
|
@ -38,7 +39,7 @@ To install LAMMPS do the following once:
|
|||
|
||||
$ sudo apt-get install lammps-daily
|
||||
|
||||
This downloads an executable named "lmp_daily" to your box, which
|
||||
This downloads an executable named ``lmp_daily`` to your box, which
|
||||
can then be used in the usual way to run input scripts:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -60,11 +61,29 @@ To get a copy of the current documentation and examples:
|
|||
$ sudo apt-get install lammps-daily-doc
|
||||
|
||||
which will download the doc files in
|
||||
/usr/share/doc/lammps-daily-doc/doc and example problems in
|
||||
/usr/share/doc/lammps-doc/examples.
|
||||
``/usr/share/doc/lammps-daily-doc/doc`` and example problems in
|
||||
``/usr/share/doc/lammps-doc/examples``.
|
||||
|
||||
Note that you may still wish to download the tarball to get potential
|
||||
files and auxiliary tools.
|
||||
To get a copy of the current potentials files:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install lammps-daily-data
|
||||
|
||||
which will download the potentials files to
|
||||
``/usr/share/lammps-daily/potentials``. The ``lmp_daily`` binary is
|
||||
hard-coded to look for potential files in this directory (it does not
|
||||
use the `LAMMPS_POTENTIALS` environment variable, as described
|
||||
in :doc:`pair_coeff <pair_coeff>` command).
|
||||
|
||||
The ``lmp_daily`` binary is built with the :ref:`KIM package <kim>` which
|
||||
results in the above command also installing the `kim-api` binaries when LAMMPS
|
||||
is installed. In order to use potentials from `openkim.org <openkim_>`_, you
|
||||
can install the `openkim-models` package
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install openkim-models
|
||||
|
||||
To un-install LAMMPS, do the following:
|
||||
|
||||
|
@ -72,17 +91,8 @@ To un-install LAMMPS, do the following:
|
|||
|
||||
$ sudo apt-get remove lammps-daily
|
||||
|
||||
Note that the lammps-daily executable is built with the following
|
||||
sequence of make commands, as if you had done the same with the
|
||||
unpacked tarball files in the src directory:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ make yes-all
|
||||
$ make no-lib
|
||||
$ make mpi
|
||||
|
||||
Thus it builds with FFTW3 and OpenMPI.
|
||||
Please use ``lmp_daily -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
|
||||
Thanks to Anton Gladky (gladky.anton at gmail.com) for setting up this
|
||||
Ubuntu package capability.
|
||||
|
@ -103,14 +113,14 @@ linking to the C library interface (lammps-devel, lammps-mpich-devel,
|
|||
lammps-openmpi-devel), the header for compiling programs using
|
||||
the C library interface (lammps-headers), and the LAMMPS python
|
||||
module for Python 3. All packages can be installed at the same
|
||||
time and the name of the LAMMPS executable is *lmp* and *lmp_openmpi*
|
||||
or *lmp_mpich* respectively. By default, *lmp* will refer to the
|
||||
time and the name of the LAMMPS executable is ``lmp`` and ``lmp_openmpi``
|
||||
or ``lmp_mpich`` respectively. By default, ``lmp`` will refer to the
|
||||
serial executable, unless one of the MPI environment modules is loaded
|
||||
("module load mpi/mpich-x86_64" or "module load mpi/openmpi-x86_64").
|
||||
(``module load mpi/mpich-x86_64`` or ``module load mpi/openmpi-x86_64``).
|
||||
Then the corresponding parallel LAMMPS executable can be used.
|
||||
The same mechanism applies when loading the LAMMPS python module.
|
||||
|
||||
To install LAMMPS with OpenMPI and run an input in.lj with 2 CPUs do:
|
||||
To install LAMMPS with OpenMPI and run an input ``in.lj`` with 2 CPUs do:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -118,10 +128,10 @@ To install LAMMPS with OpenMPI and run an input in.lj with 2 CPUs do:
|
|||
$ module load mpi/openmpi-x86_64
|
||||
$ mpirun -np 2 lmp -in in.lj
|
||||
|
||||
The "dnf install" command is needed only once. In case of a new LAMMPS
|
||||
stable release, "dnf update" will automatically update to the newer
|
||||
The ``dnf install`` command is needed only once. In case of a new LAMMPS
|
||||
stable release, ``dnf update`` will automatically update to the newer
|
||||
version as soon at the RPM files are built and uploaded to the download
|
||||
mirrors. The "module load" command is needed once per (shell) session
|
||||
mirrors. The ``module load`` command is needed once per (shell) session
|
||||
or shell terminal instance, unless it is automatically loaded from the
|
||||
shell profile.
|
||||
|
||||
|
@ -134,7 +144,7 @@ can install the `openkim-models` package
|
|||
|
||||
$ dnf install openkim-models
|
||||
|
||||
Please use "lmp -help" to see which compilation options, packages,
|
||||
Please use ``lmp -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
|
||||
Thanks to Christoph Junghans (LANL) for making LAMMPS available in Fedora.
|
||||
|
@ -153,10 +163,10 @@ in the `Extra Packages for Enterprise Linux (EPEL) repository <https://fedorapro
|
|||
for use with Red Hat Enterprise Linux (RHEL) or CentOS version 7.x
|
||||
and compatible Linux distributions. Names of packages, executable,
|
||||
and content are the same as described above for Fedora Linux.
|
||||
But RHEL/CentOS 7.x uses the "yum" package manager instead of "dnf"
|
||||
But RHEL/CentOS 7.x uses the ``yum`` package manager instead of ``dnf``
|
||||
in Fedora 28.
|
||||
|
||||
Please use "lmp -help" to see which compilation options, packages,
|
||||
Please use ``lmp -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
|
||||
Thanks to Christoph Junghans (LANL) for making LAMMPS available in EPEL.
|
||||
|
@ -176,13 +186,13 @@ in OpenSuse as of Leap 15.0. You can install the package with:
|
|||
$ zypper install lammps
|
||||
|
||||
This includes support for OpenMPI. The name of the LAMMPS executable
|
||||
is *lmp*\ . Thus to run an input in parallel on 2 CPUs you would do:
|
||||
is ``lmp``. Thus to run an input in parallel on 2 CPUs you would do:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ mpirun -np 2 lmp -in in.lj
|
||||
|
||||
Please use "lmp -help" to see which compilation options, packages,
|
||||
Please use ``lmp -help`` to see which compilation options, packages,
|
||||
and styles are included in the binary.
|
||||
|
||||
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
||||
|
|
|
@ -4,7 +4,7 @@ compute orientorder/atom command
|
|||
================================
|
||||
|
||||
compute orientorder/atom/kk command
|
||||
=======================
|
||||
===================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
|
|
@ -72,21 +72,21 @@ void AngleCharmmKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
//if(k_eatom.extent(0)<maxeatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_eatom,eatom);
|
||||
memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom");
|
||||
d_eatom = k_eatom.template view<DeviceType>();
|
||||
d_eatom = k_eatom.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
if (vflag_atom) {
|
||||
//if(k_vatom.extent(0)<maxvatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_vatom,vatom);
|
||||
memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"improper:vatom");
|
||||
d_vatom = k_vatom.template view<DeviceType>();
|
||||
d_vatom = k_vatom.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
|
||||
x = atomKK->k_x.view<DeviceType>();
|
||||
f = atomKK->k_f.view<DeviceType>();
|
||||
neighborKK->k_anglelist.template sync<DeviceType>();
|
||||
anglelist = neighborKK->k_anglelist.view<DeviceType>();
|
||||
anglelist = neighborKK->k_anglelist.view<KKDeviceType>();
|
||||
int nanglelist = neighborKK->nanglelist;
|
||||
nlocal = atom->nlocal;
|
||||
newton_bond = force->newton_bond;
|
||||
|
@ -265,10 +265,10 @@ void AngleCharmmKokkos<DeviceType>::coeff(int narg, char **arg)
|
|||
AngleCharmm::coeff(narg, arg);
|
||||
|
||||
int n = atom->nangletypes;
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k("AngleCharmm::k",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_theta0("AngleCharmm::theta0",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k_ub("AngleCharmm::k_ub",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_r_ub("AngleCharmm::r_ub",n+1);
|
||||
typename AT::tdual_ffloat_1d k_k("AngleCharmm::k",n+1);
|
||||
typename AT::tdual_ffloat_1d k_theta0("AngleCharmm::theta0",n+1);
|
||||
typename AT::tdual_ffloat_1d k_k_ub("AngleCharmm::k_ub",n+1);
|
||||
typename AT::tdual_ffloat_1d k_r_ub("AngleCharmm::r_ub",n+1);
|
||||
|
||||
d_k = k_k.template view<DeviceType>();
|
||||
d_theta0 = k_theta0.template view<DeviceType>();
|
||||
|
@ -303,10 +303,10 @@ void AngleCharmmKokkos<DeviceType>::read_restart(FILE *fp)
|
|||
AngleCharmm::read_restart(fp);
|
||||
|
||||
int n = atom->nangletypes;
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k("AngleCharmm::k",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_theta0("AngleCharmm::theta0",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k_ub("AngleCharmm::k_ub",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_r_ub("AngleCharmm::r_ub",n+1);
|
||||
typename AT::tdual_ffloat_1d k_k("AngleCharmm::k",n+1);
|
||||
typename AT::tdual_ffloat_1d k_theta0("AngleCharmm::theta0",n+1);
|
||||
typename AT::tdual_ffloat_1d k_k_ub("AngleCharmm::k_ub",n+1);
|
||||
typename AT::tdual_ffloat_1d k_r_ub("AngleCharmm::r_ub",n+1);
|
||||
|
||||
d_k = k_k.template view<DeviceType>();
|
||||
d_theta0 = k_theta0.template view<DeviceType>();
|
||||
|
|
|
@ -63,11 +63,13 @@ class AngleCharmmKokkos : public AngleCharmm {
|
|||
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
typename AT::t_x_array_randomread x;
|
||||
typename Kokkos::View<double*[3],typename AT::t_f_array::array_layout,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > f;
|
||||
|
||||
typedef typename KKDevice<DeviceType>::value KKDeviceType;
|
||||
typename Kokkos::View<double*[3],typename AT::t_f_array::array_layout,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > f;
|
||||
typename AT::t_int_2d anglelist;
|
||||
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,DeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,DeviceType> k_vatom;
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType> k_vatom;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom;
|
||||
|
||||
|
|
|
@ -153,15 +153,7 @@ class AtomVecKokkos : public AtomVec {
|
|||
buffer = Kokkos::kokkos_realloc<Kokkos::CudaHostPinnedSpace>(buffer,src.span());
|
||||
buffer_size = src.span();
|
||||
}
|
||||
return mirror_type( buffer ,
|
||||
src.extent(0) ,
|
||||
src.extent(1) ,
|
||||
src.extent(2) ,
|
||||
src.extent(3) ,
|
||||
src.extent(4) ,
|
||||
src.extent(5) ,
|
||||
src.extent(6) ,
|
||||
src.extent(7) );
|
||||
return mirror_type(buffer, src.d_view.layout());
|
||||
}
|
||||
|
||||
template<class ViewType>
|
||||
|
@ -179,15 +171,8 @@ class AtomVecKokkos : public AtomVec {
|
|||
buffer = Kokkos::kokkos_realloc<Kokkos::CudaHostPinnedSpace>(buffer,src.span()*sizeof(typename ViewType::value_type));
|
||||
buffer_size = src.span();
|
||||
}
|
||||
mirror_type tmp_view( (typename ViewType::value_type*)buffer ,
|
||||
src.extent(0) ,
|
||||
src.extent(1) ,
|
||||
src.extent(2) ,
|
||||
src.extent(3) ,
|
||||
src.extent(4) ,
|
||||
src.extent(5) ,
|
||||
src.extent(6) ,
|
||||
src.extent(7) );
|
||||
mirror_type tmp_view((typename ViewType::value_type*)buffer, src.d_view.layout());
|
||||
|
||||
if(space == Device) {
|
||||
Kokkos::deep_copy(LMPHostType(),tmp_view,src.h_view),
|
||||
Kokkos::deep_copy(LMPHostType(),src.d_view,tmp_view);
|
||||
|
|
|
@ -69,14 +69,14 @@ void BondHarmonicKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
//if(k_eatom.extent(0)<maxeatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_eatom,eatom);
|
||||
memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom");
|
||||
d_eatom = k_eatom.template view<DeviceType>();
|
||||
d_eatom = k_eatom.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
if (vflag_atom) {
|
||||
//if(k_vatom.extent(0)<maxvatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_vatom,vatom);
|
||||
memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"improper:vatom");
|
||||
d_vatom = k_vatom.template view<DeviceType>();
|
||||
d_vatom = k_vatom.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
|
||||
|
@ -204,8 +204,8 @@ void BondHarmonicKokkos<DeviceType>::coeff(int narg, char **arg)
|
|||
BondHarmonic::coeff(narg, arg);
|
||||
|
||||
int n = atom->nbondtypes;
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k("BondHarmonic::k",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_r0("BondHarmonic::r0",n+1);
|
||||
typename AT::tdual_ffloat_1d k_k("BondHarmonic::k",n+1);
|
||||
typename AT::tdual_ffloat_1d k_r0("BondHarmonic::r0",n+1);
|
||||
|
||||
d_k = k_k.template view<DeviceType>();
|
||||
d_r0 = k_r0.template view<DeviceType>();
|
||||
|
@ -231,8 +231,8 @@ void BondHarmonicKokkos<DeviceType>::read_restart(FILE *fp)
|
|||
BondHarmonic::read_restart(fp);
|
||||
|
||||
int n = atom->nbondtypes;
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k("BondHarmonic::k",n+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_r0("BondHarmonic::r0",n+1);
|
||||
typename AT::tdual_ffloat_1d k_k("BondHarmonic::k",n+1);
|
||||
typename AT::tdual_ffloat_1d k_r0("BondHarmonic::r0",n+1);
|
||||
|
||||
d_k = k_k.template view<DeviceType>();
|
||||
d_r0 = k_r0.template view<DeviceType>();
|
||||
|
|
|
@ -66,10 +66,11 @@ class BondHarmonicKokkos : public BondHarmonic {
|
|||
typename Kokkos::View<double*[3],typename AT::t_f_array::array_layout,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > f;
|
||||
typename AT::t_int_2d bondlist;
|
||||
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,DeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,DeviceType> k_vatom;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom;
|
||||
typedef typename KKDevice<DeviceType>::value KKDeviceType;
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType> k_vatom;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom;
|
||||
|
||||
int nlocal,newton_bond;
|
||||
int eflag,vflag;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "memory_kokkos.h"
|
||||
#include "error.h"
|
||||
#include "atom_masks.h"
|
||||
#include "kokkos.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
|
@ -69,6 +70,9 @@ void DihedralCharmmKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
eflag = eflag_in;
|
||||
vflag = vflag_in;
|
||||
|
||||
if (lmp->kokkos->neighflag == FULL)
|
||||
error->all(FLERR,"Dihedral_style charmm/kk requires half neighbor list");
|
||||
|
||||
ev_init(eflag,vflag,0);
|
||||
|
||||
// insure pair->ev_tally() will use 1-4 virial contribution
|
||||
|
@ -82,18 +86,18 @@ void DihedralCharmmKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
//if(k_eatom.extent(0)<maxeatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_eatom,eatom);
|
||||
memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom");
|
||||
d_eatom = k_eatom.template view<DeviceType>();
|
||||
k_eatom_pair = Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,DeviceType>("dihedral:eatom_pair",maxeatom);
|
||||
d_eatom_pair = k_eatom.template view<DeviceType>();
|
||||
d_eatom = k_eatom.template view<KKDeviceType>();
|
||||
k_eatom_pair = Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType>("dihedral:eatom_pair",maxeatom);
|
||||
d_eatom_pair = k_eatom_pair.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
if (vflag_atom) {
|
||||
//if(k_vatom.extent(0)<maxvatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_vatom,vatom);
|
||||
memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"dihedral:vatom");
|
||||
d_vatom = k_vatom.template view<DeviceType>();
|
||||
k_vatom_pair = Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,DeviceType>("dihedral:vatom_pair",maxvatom);
|
||||
d_vatom_pair = k_vatom.template view<DeviceType>();
|
||||
d_vatom = k_vatom.template view<KKDeviceType>();
|
||||
k_vatom_pair = Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType>("dihedral:vatom_pair",maxvatom);
|
||||
d_vatom_pair = k_vatom_pair.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
|
||||
|
@ -424,12 +428,12 @@ void DihedralCharmmKokkos<DeviceType>::coeff(int narg, char **arg)
|
|||
DihedralCharmm::coeff(narg, arg);
|
||||
|
||||
int nd = atom->ndihedraltypes;
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k("DihedralCharmm::k",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_multiplicity("DihedralCharmm::multiplicity",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_shift("DihedralCharmm::shift",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_cos_shift("DihedralCharmm::cos_shift",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_sin_shift("DihedralCharmm::sin_shift",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_weight("DihedralCharmm::weight",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_k("DihedralCharmm::k",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_multiplicity("DihedralCharmm::multiplicity",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_shift("DihedralCharmm::shift",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_cos_shift("DihedralCharmm::cos_shift",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_sin_shift("DihedralCharmm::sin_shift",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_weight("DihedralCharmm::weight",nd+1);
|
||||
|
||||
d_k = k_k.template view<DeviceType>();
|
||||
d_multiplicity = k_multiplicity.template view<DeviceType>();
|
||||
|
@ -473,10 +477,10 @@ void DihedralCharmmKokkos<DeviceType>::init_style()
|
|||
DihedralCharmm::init_style();
|
||||
|
||||
int n = atom->ntypes;
|
||||
Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_1("DihedralCharmm:lj14_1",n+1,n+1);
|
||||
Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_2("DihedralCharmm:lj14_2",n+1,n+1);
|
||||
Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_3("DihedralCharmm:lj14_3",n+1,n+1);
|
||||
Kokkos::DualView<F_FLOAT**,Kokkos::LayoutRight,DeviceType> k_lj14_4("DihedralCharmm:lj14_4",n+1,n+1);
|
||||
DAT::tdual_ffloat_2d k_lj14_1("DihedralCharmm:lj14_1",n+1,n+1);
|
||||
DAT::tdual_ffloat_2d k_lj14_2("DihedralCharmm:lj14_2",n+1,n+1);
|
||||
DAT::tdual_ffloat_2d k_lj14_3("DihedralCharmm:lj14_3",n+1,n+1);
|
||||
DAT::tdual_ffloat_2d k_lj14_4("DihedralCharmm:lj14_4",n+1,n+1);
|
||||
|
||||
d_lj14_1 = k_lj14_1.template view<DeviceType>();
|
||||
d_lj14_2 = k_lj14_2.template view<DeviceType>();
|
||||
|
@ -517,12 +521,12 @@ void DihedralCharmmKokkos<DeviceType>::read_restart(FILE *fp)
|
|||
DihedralCharmm::read_restart(fp);
|
||||
|
||||
int nd = atom->ndihedraltypes;
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_k("DihedralCharmm::k",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_multiplicity("DihedralCharmm::multiplicity",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_shift("DihedralCharmm::shift",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_cos_shift("DihedralCharmm::cos_shift",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_sin_shift("DihedralCharmm::sin_shift",nd+1);
|
||||
Kokkos::DualView<F_FLOAT*,DeviceType> k_weight("DihedralCharmm::weight",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_k("DihedralCharmm::k",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_multiplicity("DihedralCharmm::multiplicity",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_shift("DihedralCharmm::shift",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_cos_shift("DihedralCharmm::cos_shift",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_sin_shift("DihedralCharmm::sin_shift",nd+1);
|
||||
typename AT::tdual_ffloat_1d k_weight("DihedralCharmm::weight",nd+1);
|
||||
|
||||
d_k = k_k.template view<DeviceType>();
|
||||
d_multiplicity = k_multiplicity.template view<DeviceType>();
|
||||
|
|
|
@ -132,15 +132,16 @@ class DihedralCharmmKokkos : public DihedralCharmm {
|
|||
typename AT::t_f_array f;
|
||||
typename AT::t_int_2d dihedrallist;
|
||||
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,DeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,DeviceType> k_vatom;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom;
|
||||
typedef typename KKDevice<DeviceType>::value KKDeviceType;
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType> k_vatom;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom;
|
||||
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,DeviceType> k_eatom_pair;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,DeviceType> k_vatom_pair;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom_pair;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom_pair;
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType> k_eatom_pair;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType> k_vatom_pair;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom_pair;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom_pair;
|
||||
|
||||
int nlocal,newton_bond;
|
||||
int eflag,vflag;
|
||||
|
|
|
@ -39,8 +39,6 @@ using namespace FixConst;
|
|||
#define SMALL 0.0001
|
||||
#define EV_TO_KCAL_PER_MOL 14.4
|
||||
|
||||
#define TEAMSIZE 128
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
|
@ -726,7 +724,9 @@ void FixQEqReaxKokkos<DeviceType>::cg_solve1()
|
|||
const int inum = list->inum;
|
||||
F_FLOAT tmp, sig_old, b_norm;
|
||||
|
||||
const int teamsize = TEAMSIZE;
|
||||
int teamsize;
|
||||
if (execution_space == Host) teamsize = 1;
|
||||
else teamsize = 128;
|
||||
|
||||
// sparse_matvec( &H, x, q );
|
||||
FixQEqReaxKokkosSparse12Functor<DeviceType> sparse12_functor(this);
|
||||
|
@ -861,7 +861,9 @@ void FixQEqReaxKokkos<DeviceType>::cg_solve2()
|
|||
const int inum = list->inum;
|
||||
F_FLOAT tmp, sig_old, b_norm;
|
||||
|
||||
const int teamsize = TEAMSIZE;
|
||||
int teamsize;
|
||||
if (execution_space == Host) teamsize = 1;
|
||||
else teamsize = 128;
|
||||
|
||||
// sparse_matvec( &H, x, q );
|
||||
FixQEqReaxKokkosSparse32Functor<DeviceType> sparse32_functor(this);
|
||||
|
|
|
@ -73,14 +73,14 @@ void ImproperHarmonicKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
//if(k_eatom.extent(0)<maxeatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_eatom,eatom);
|
||||
memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom");
|
||||
d_eatom = k_eatom.template view<DeviceType>();
|
||||
d_eatom = k_eatom.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
if (vflag_atom) {
|
||||
//if(k_vatom.extent(0)<maxvatom) { // won't work without adding zero functor
|
||||
memoryKK->destroy_kokkos(k_vatom,vatom);
|
||||
memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"improper:vatom");
|
||||
d_vatom = k_vatom.template view<DeviceType>();
|
||||
d_vatom = k_vatom.template view<KKDeviceType>();
|
||||
//}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,14 +63,15 @@ class ImproperHarmonicKokkos : public ImproperHarmonic {
|
|||
|
||||
class NeighborKokkos *neighborKK;
|
||||
|
||||
typedef typename KKDevice<DeviceType>::value KKDeviceType;
|
||||
typename AT::t_x_array_randomread x;
|
||||
typename Kokkos::View<double*[3],typename AT::t_f_array::array_layout,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > f;
|
||||
typename Kokkos::View<double*[3],typename AT::t_f_array::array_layout,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > f;
|
||||
typename AT::t_int_2d improperlist;
|
||||
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,DeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,DeviceType> k_vatom;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,typename KKDevice<DeviceType>::value,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom;
|
||||
Kokkos::DualView<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType> k_eatom;
|
||||
Kokkos::DualView<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType> k_vatom;
|
||||
Kokkos::View<E_FLOAT*,Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_eatom;
|
||||
Kokkos::View<F_FLOAT*[6],Kokkos::LayoutRight,KKDeviceType,Kokkos::MemoryTraits<Kokkos::Atomic> > d_vatom;
|
||||
|
||||
int nlocal,newton_bond;
|
||||
int eflag,vflag;
|
||||
|
|
|
@ -306,7 +306,7 @@ void KokkosLMP::accelerator(int narg, char **arg)
|
|||
neighflag = HALFTHREAD;
|
||||
else
|
||||
neighflag = HALF;
|
||||
} else if (strcmp(arg[iarg+1],"n2") == 0) neighflag = N2;
|
||||
}
|
||||
else error->all(FLERR,"Illegal package kokkos command");
|
||||
if (!neighflag_qeq_set) neighflag_qeq = neighflag;
|
||||
iarg += 2;
|
||||
|
@ -318,7 +318,7 @@ void KokkosLMP::accelerator(int narg, char **arg)
|
|||
neighflag_qeq = HALFTHREAD;
|
||||
else
|
||||
neighflag_qeq = HALF;
|
||||
} else if (strcmp(arg[iarg+1],"n2") == 0) neighflag_qeq = N2;
|
||||
}
|
||||
else error->all(FLERR,"Illegal package kokkos command");
|
||||
neighflag_qeq_set = 1;
|
||||
iarg += 2;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <Kokkos_Vectorization.hpp>
|
||||
#include <Kokkos_ScatterView.hpp>
|
||||
|
||||
enum{FULL=1u,HALFTHREAD=2u,HALF=4u,N2=8u};
|
||||
enum{FULL=1u,HALFTHREAD=2u,HALF=4u};
|
||||
|
||||
#if defined(KOKKOS_ENABLE_CXX11)
|
||||
#undef ISFINITE
|
||||
|
|
|
@ -307,9 +307,6 @@ void PairBuckCoulCutKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with buck/coul/cut/kk");
|
||||
}
|
||||
|
|
|
@ -229,9 +229,6 @@ void PairBuckKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with buck/kk");
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace LAMMPS_NS {
|
|||
template<class DeviceType>
|
||||
class PairBuckKokkos : public PairBuck {
|
||||
public:
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
enum {COUL_FLAG=0};
|
||||
typedef DeviceType device_type;
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
|
@ -98,15 +98,12 @@ class PairBuckKokkos : public PairBuck {
|
|||
friend class PairComputeFunctor<PairBuckKokkos,FULL,true>;
|
||||
friend class PairComputeFunctor<PairBuckKokkos,HALF,true>;
|
||||
friend class PairComputeFunctor<PairBuckKokkos,HALFTHREAD,true>;
|
||||
friend class PairComputeFunctor<PairBuckKokkos,N2,true>;
|
||||
friend class PairComputeFunctor<PairBuckKokkos,FULL,false>;
|
||||
friend class PairComputeFunctor<PairBuckKokkos,HALF,false>;
|
||||
friend class PairComputeFunctor<PairBuckKokkos,HALFTHREAD,false>;
|
||||
friend class PairComputeFunctor<PairBuckKokkos,N2,false>;
|
||||
friend EV_FLOAT pair_compute_neighlist<PairBuckKokkos,FULL,void>(PairBuckKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairBuckKokkos,HALF,void>(PairBuckKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairBuckKokkos,HALFTHREAD,void>(PairBuckKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairBuckKokkos,N2,void>(PairBuckKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute<PairBuckKokkos,void>(PairBuckKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend void pair_virial_fdotr_compute<PairBuckKokkos>(PairBuckKokkos*);
|
||||
};
|
||||
|
|
|
@ -276,9 +276,6 @@ void PairCoulDebyeKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with coul/debye/kk");
|
||||
}
|
||||
|
|
|
@ -87,6 +87,8 @@ struct PairComputeFunctor {
|
|||
c(*c_ptr),list(*list_ptr) {
|
||||
// allocate duplicated memory
|
||||
f = c.f;
|
||||
d_eatom = c.d_eatom;
|
||||
d_vatom = c.d_vatom;
|
||||
dup_f = Kokkos::Experimental::create_scatter_view<Kokkos::Experimental::ScatterSum, NeedDup<NEIGHFLAG,device_type>::value >(c.f);
|
||||
dup_eatom = Kokkos::Experimental::create_scatter_view<Kokkos::Experimental::ScatterSum, NeedDup<NEIGHFLAG,device_type>::value >(c.d_eatom);
|
||||
dup_vatom = Kokkos::Experimental::create_scatter_view<Kokkos::Experimental::ScatterSum, NeedDup<NEIGHFLAG,device_type>::value >(c.d_vatom);
|
||||
|
@ -422,15 +424,15 @@ struct PairComputeFunctor {
|
|||
F_FLOAT evdwl = 0.0;
|
||||
if (c.eflag) {
|
||||
evdwl = factor_lj * c.template compute_evdwl<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
|
||||
fev.evdwl += 0.5*evdwl;
|
||||
fev_tmp.evdwl += 0.5*evdwl;
|
||||
}
|
||||
if (c.vflag_either) {
|
||||
fev.v[0] += 0.5*delx*delx*fpair;
|
||||
fev.v[1] += 0.5*dely*dely*fpair;
|
||||
fev.v[2] += 0.5*delz*delz*fpair;
|
||||
fev.v[3] += 0.5*delx*dely*fpair;
|
||||
fev.v[4] += 0.5*delx*delz*fpair;
|
||||
fev.v[5] += 0.5*dely*delz*fpair;
|
||||
fev_tmp.v[0] += 0.5*delx*delx*fpair;
|
||||
fev_tmp.v[1] += 0.5*dely*dely*fpair;
|
||||
fev_tmp.v[2] += 0.5*delz*delz*fpair;
|
||||
fev_tmp.v[3] += 0.5*delx*dely*fpair;
|
||||
fev_tmp.v[4] += 0.5*delx*delz*fpair;
|
||||
fev_tmp.v[5] += 0.5*dely*delz*fpair;
|
||||
}
|
||||
}
|
||||
},fev);
|
||||
|
@ -479,8 +481,8 @@ struct PairComputeFunctor {
|
|||
|
||||
const int inum = team.league_size();
|
||||
const int atoms_per_team = team.team_size();
|
||||
int firstatom = team.league_rank()*atoms_per_team;
|
||||
int lastatom = firstatom + atoms_per_team < inum ? firstatom + atoms_per_team : inum;
|
||||
const int firstatom = team.league_rank()*atoms_per_team;
|
||||
const int lastatom = firstatom + atoms_per_team < inum ? firstatom + atoms_per_team : inum;
|
||||
Kokkos::parallel_for(Kokkos::TeamThreadRange(team, firstatom, lastatom), [&] (const int &ii) {
|
||||
|
||||
const int i = list.d_ilist[ii];
|
||||
|
@ -497,6 +499,7 @@ struct PairComputeFunctor {
|
|||
|
||||
Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(team,jnum),
|
||||
[&] (const int jj, FEV_FLOAT& fev_tmp) {
|
||||
|
||||
int j = neighbors_i(jj);
|
||||
const F_FLOAT factor_lj = c.special_lj[sbmask(j)];
|
||||
const F_FLOAT factor_coul = c.special_coul[sbmask(j)];
|
||||
|
@ -516,29 +519,29 @@ struct PairComputeFunctor {
|
|||
if(rsq < (STACKPARAMS?c.m_cut_coulsq[itype][jtype]:c.d_cut_coulsq(itype,jtype)))
|
||||
fpair+=c.template compute_fcoul<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype,factor_coul,qtmp);
|
||||
|
||||
fev.f[0] += delx*fpair;
|
||||
fev.f[1] += dely*fpair;
|
||||
fev.f[2] += delz*fpair;
|
||||
fev_tmp.f[0] += delx*fpair;
|
||||
fev_tmp.f[1] += dely*fpair;
|
||||
fev_tmp.f[2] += delz*fpair;
|
||||
|
||||
F_FLOAT evdwl = 0.0;
|
||||
F_FLOAT ecoul = 0.0;
|
||||
if (c.eflag) {
|
||||
if(rsq < (STACKPARAMS?c.m_cut_ljsq[itype][jtype]:c.d_cut_ljsq(itype,jtype))) {
|
||||
evdwl = factor_lj * c.template compute_evdwl<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
|
||||
ev.evdwl += 0.5*evdwl;
|
||||
fev_tmp.evdwl += 0.5*evdwl;
|
||||
}
|
||||
if(rsq < (STACKPARAMS?c.m_cut_coulsq[itype][jtype]:c.d_cut_coulsq(itype,jtype))) {
|
||||
ecoul = c.template compute_ecoul<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype,factor_coul,qtmp);
|
||||
ev.ecoul += 0.5*ecoul;
|
||||
fev_tmp.ecoul += 0.5*ecoul;
|
||||
}
|
||||
}
|
||||
if (c.vflag) {
|
||||
fev.v[0] += 0.5*delx*delx*fpair;
|
||||
fev.v[1] += 0.5*dely*dely*fpair;
|
||||
fev.v[2] += 0.5*delz*delz*fpair;
|
||||
fev.v[3] += 0.5*delx*dely*fpair;
|
||||
fev.v[4] += 0.5*delx*delz*fpair;
|
||||
fev.v[5] += 0.5*dely*delz*fpair;
|
||||
if (c.vflag_either) {
|
||||
fev_tmp.v[0] += 0.5*delx*delx*fpair;
|
||||
fev_tmp.v[1] += 0.5*dely*dely*fpair;
|
||||
fev_tmp.v[2] += 0.5*delz*delz*fpair;
|
||||
fev_tmp.v[3] += 0.5*delx*dely*fpair;
|
||||
fev_tmp.v[4] += 0.5*delx*delz*fpair;
|
||||
fev_tmp.v[5] += 0.5*dely*delz*fpair;
|
||||
}
|
||||
}
|
||||
},fev);
|
||||
|
@ -690,148 +693,6 @@ struct PairComputeFunctor {
|
|||
}
|
||||
};
|
||||
|
||||
template <class PairStyle, bool STACKPARAMS, class Specialisation>
|
||||
struct PairComputeFunctor<PairStyle,N2,STACKPARAMS,Specialisation> {
|
||||
typedef typename PairStyle::device_type device_type ;
|
||||
typedef EV_FLOAT value_type;
|
||||
|
||||
PairStyle c;
|
||||
NeighListKokkos<device_type> list;
|
||||
|
||||
PairComputeFunctor(PairStyle* c_ptr,
|
||||
NeighListKokkos<device_type>* list_ptr):
|
||||
c(*c_ptr),list(*list_ptr) {};
|
||||
~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;};
|
||||
|
||||
KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const {
|
||||
return j >> SBBITS & 3;
|
||||
}
|
||||
|
||||
|
||||
void contribute() {}
|
||||
|
||||
template<int EVFLAG, int NEWTON_PAIR>
|
||||
KOKKOS_FUNCTION
|
||||
EV_FLOAT compute_item(const int& ii,
|
||||
const NeighListKokkos<device_type> &list, const NoCoulTag&) const {
|
||||
(void) list;
|
||||
EV_FLOAT ev;
|
||||
const int i = ii;//list.d_ilist[ii];
|
||||
const X_FLOAT xtmp = c.x(i,0);
|
||||
const X_FLOAT ytmp = c.x(i,1);
|
||||
const X_FLOAT ztmp = c.x(i,2);
|
||||
const int itype = c.type(i);
|
||||
|
||||
//const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i);
|
||||
const int jnum = c.nall;
|
||||
|
||||
F_FLOAT fxtmp = 0.0;
|
||||
F_FLOAT fytmp = 0.0;
|
||||
F_FLOAT fztmp = 0.0;
|
||||
|
||||
for (int jj = 0; jj < jnum; jj++) {
|
||||
int j = jj;//neighbors_i(jj);
|
||||
if(i==j) continue;
|
||||
const F_FLOAT factor_lj = c.special_lj[sbmask(j)];
|
||||
j &= NEIGHMASK;
|
||||
const X_FLOAT delx = xtmp - c.x(j,0);
|
||||
const X_FLOAT dely = ytmp - c.x(j,1);
|
||||
const X_FLOAT delz = ztmp - c.x(j,2);
|
||||
const int jtype = c.type(j);
|
||||
const F_FLOAT rsq = delx*delx + dely*dely + delz*delz;
|
||||
|
||||
if(rsq < (STACKPARAMS?c.m_cutsq[itype][jtype]:c.d_cutsq(itype,jtype))) {
|
||||
|
||||
const F_FLOAT fpair = factor_lj*c.template compute_fpair<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
|
||||
fxtmp += delx*fpair;
|
||||
fytmp += dely*fpair;
|
||||
fztmp += delz*fpair;
|
||||
|
||||
if (EVFLAG) {
|
||||
F_FLOAT evdwl = 0.0;
|
||||
if (c.eflag) {
|
||||
evdwl = 0.5*
|
||||
factor_lj * c.template compute_evdwl<STACKPARAMS,Specialisation>(rsq,i,j,itype,jtype);
|
||||
ev.evdwl += evdwl;
|
||||
}
|
||||
|
||||
if (c.vflag_either || c.eflag_atom) ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c.f(i,0) += fxtmp;
|
||||
c.f(i,1) += fytmp;
|
||||
c.f(i,2) += fztmp;
|
||||
|
||||
return ev;
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
|
||||
const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx,
|
||||
const F_FLOAT &dely, const F_FLOAT &delz) const
|
||||
{
|
||||
const int EFLAG = c.eflag;
|
||||
const int VFLAG = c.vflag_either;
|
||||
|
||||
if (EFLAG) {
|
||||
if (c.eflag_atom) {
|
||||
const E_FLOAT epairhalf = 0.5 * epair;
|
||||
if (i < c.nlocal) c.d_eatom[i] += epairhalf;
|
||||
if (j < c.nlocal) c.d_eatom[j] += epairhalf;
|
||||
}
|
||||
}
|
||||
|
||||
if (VFLAG) {
|
||||
const E_FLOAT v0 = delx*delx*fpair;
|
||||
const E_FLOAT v1 = dely*dely*fpair;
|
||||
const E_FLOAT v2 = delz*delz*fpair;
|
||||
const E_FLOAT v3 = delx*dely*fpair;
|
||||
const E_FLOAT v4 = delx*delz*fpair;
|
||||
const E_FLOAT v5 = dely*delz*fpair;
|
||||
|
||||
if (c.vflag_global) {
|
||||
ev.v[0] += 0.5*v0;
|
||||
ev.v[1] += 0.5*v1;
|
||||
ev.v[2] += 0.5*v2;
|
||||
ev.v[3] += 0.5*v3;
|
||||
ev.v[4] += 0.5*v4;
|
||||
ev.v[5] += 0.5*v5;
|
||||
}
|
||||
|
||||
if (c.vflag_atom) {
|
||||
if (i < c.nlocal) {
|
||||
c.d_vatom(i,0) += 0.5*v0;
|
||||
c.d_vatom(i,1) += 0.5*v1;
|
||||
c.d_vatom(i,2) += 0.5*v2;
|
||||
c.d_vatom(i,3) += 0.5*v3;
|
||||
c.d_vatom(i,4) += 0.5*v4;
|
||||
c.d_vatom(i,5) += 0.5*v5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(const int i) const {
|
||||
compute_item<0,0>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(const int i, value_type &energy_virial) const {
|
||||
energy_virial += compute_item<1,0>(i,list,typename DoCoul<PairStyle::COUL_FLAG>::type());
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(const typename Kokkos::TeamPolicy<>::member_type& team) const
|
||||
{}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(const typename Kokkos::TeamPolicy<>::member_type& team, value_type &energy_virial) const
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
// Filter out Neighflags which are not supported for PairStyle
|
||||
// The enable_if clause will invalidate the last parameter of the function, so that
|
||||
|
@ -867,7 +728,7 @@ int GetTeamSize(FunctorStyle& functor, int inum, int reduce_flag, int team_size,
|
|||
return team_size;
|
||||
}
|
||||
|
||||
// Submit ParallelFor for NEIGHFLAG=HALF,HALFTHREAD,FULL,N2
|
||||
// Submit ParallelFor for NEIGHFLAG=HALF,HALFTHREAD,FULL
|
||||
template<class PairStyle, unsigned NEIGHFLAG, class Specialisation>
|
||||
EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename std::enable_if<(NEIGHFLAG&PairStyle::EnabledNeighFlags) != 0, NeighListKokkos<typename PairStyle::device_type>*>::type list) {
|
||||
EV_FLOAT ev;
|
||||
|
@ -918,8 +779,6 @@ EV_FLOAT pair_compute (PairStyle* fpair, NeighListKokkos<typename PairStyle::dev
|
|||
ev = pair_compute_neighlist<PairStyle,HALFTHREAD,Specialisation> (fpair,list);
|
||||
} else if (fpair->neighflag == HALF) {
|
||||
ev = pair_compute_neighlist<PairStyle,HALF,Specialisation> (fpair,list);
|
||||
} else if (fpair->neighflag == N2) {
|
||||
ev = pair_compute_neighlist<PairStyle,N2,Specialisation> (fpair,list);
|
||||
}
|
||||
return ev;
|
||||
}
|
||||
|
|
|
@ -309,9 +309,6 @@ void PairLJClass2CoulCutKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/class2/coul/cut/kk");
|
||||
}
|
||||
|
|
|
@ -247,9 +247,6 @@ void PairLJClass2Kokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/class2/kk");
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace LAMMPS_NS {
|
|||
template<class DeviceType>
|
||||
class PairLJClass2Kokkos : public PairLJClass2 {
|
||||
public:
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
enum {COUL_FLAG=0};
|
||||
typedef DeviceType device_type;
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
|
@ -104,15 +104,12 @@ class PairLJClass2Kokkos : public PairLJClass2 {
|
|||
friend class PairComputeFunctor<PairLJClass2Kokkos,FULL,true>;
|
||||
friend class PairComputeFunctor<PairLJClass2Kokkos,HALF,true>;
|
||||
friend class PairComputeFunctor<PairLJClass2Kokkos,HALFTHREAD,true>;
|
||||
friend class PairComputeFunctor<PairLJClass2Kokkos,N2,true>;
|
||||
friend class PairComputeFunctor<PairLJClass2Kokkos,FULL,false>;
|
||||
friend class PairComputeFunctor<PairLJClass2Kokkos,HALF,false>;
|
||||
friend class PairComputeFunctor<PairLJClass2Kokkos,HALFTHREAD,false>;
|
||||
friend class PairComputeFunctor<PairLJClass2Kokkos,N2,false>;
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJClass2Kokkos,FULL,void>(PairLJClass2Kokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJClass2Kokkos,HALF,void>(PairLJClass2Kokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJClass2Kokkos,HALFTHREAD,void>(PairLJClass2Kokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJClass2Kokkos,N2,void>(PairLJClass2Kokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute<PairLJClass2Kokkos,void>(PairLJClass2Kokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend void pair_virial_fdotr_compute<PairLJClass2Kokkos>(PairLJClass2Kokkos*);
|
||||
};
|
||||
|
|
|
@ -300,9 +300,6 @@ void PairLJCutCoulCutKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/coul/cut/kk");
|
||||
}
|
||||
|
|
|
@ -329,9 +329,6 @@ void PairLJCutCoulDebyeKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/coul/debye/kk");
|
||||
}
|
||||
|
|
|
@ -322,9 +322,6 @@ void PairLJCutCoulDSFKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/coul/cut/kk");
|
||||
}
|
||||
|
|
|
@ -241,9 +241,6 @@ void PairLJCutKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk");
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace LAMMPS_NS {
|
|||
template<class DeviceType>
|
||||
class PairLJCutKokkos : public PairLJCut {
|
||||
public:
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
enum {COUL_FLAG=0};
|
||||
typedef DeviceType device_type;
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
|
@ -99,15 +99,12 @@ class PairLJCutKokkos : public PairLJCut {
|
|||
friend class PairComputeFunctor<PairLJCutKokkos,FULL,true>;
|
||||
friend class PairComputeFunctor<PairLJCutKokkos,HALF,true>;
|
||||
friend class PairComputeFunctor<PairLJCutKokkos,HALFTHREAD,true>;
|
||||
friend class PairComputeFunctor<PairLJCutKokkos,N2,true>;
|
||||
friend class PairComputeFunctor<PairLJCutKokkos,FULL,false>;
|
||||
friend class PairComputeFunctor<PairLJCutKokkos,HALF,false>;
|
||||
friend class PairComputeFunctor<PairLJCutKokkos,HALFTHREAD,false>;
|
||||
friend class PairComputeFunctor<PairLJCutKokkos,N2,false>;
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,FULL,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,HALF,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,HALFTHREAD,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJCutKokkos,N2,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute<PairLJCutKokkos,void>(PairLJCutKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend void pair_virial_fdotr_compute<PairLJCutKokkos>(PairLJCutKokkos*);
|
||||
};
|
||||
|
|
|
@ -249,9 +249,6 @@ void PairLJExpandKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/expand/kk");
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace LAMMPS_NS {
|
|||
template<class DeviceType>
|
||||
class PairLJExpandKokkos : public PairLJExpand {
|
||||
public:
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
enum {COUL_FLAG=0};
|
||||
typedef DeviceType device_type;
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
|
@ -105,15 +105,12 @@ class PairLJExpandKokkos : public PairLJExpand {
|
|||
friend class PairComputeFunctor<PairLJExpandKokkos,FULL,true>;
|
||||
friend class PairComputeFunctor<PairLJExpandKokkos,HALF,true>;
|
||||
friend class PairComputeFunctor<PairLJExpandKokkos,HALFTHREAD,true>;
|
||||
friend class PairComputeFunctor<PairLJExpandKokkos,N2,true>;
|
||||
friend class PairComputeFunctor<PairLJExpandKokkos,FULL,false>;
|
||||
friend class PairComputeFunctor<PairLJExpandKokkos,HALF,false>;
|
||||
friend class PairComputeFunctor<PairLJExpandKokkos,HALFTHREAD,false>;
|
||||
friend class PairComputeFunctor<PairLJExpandKokkos,N2,false>;
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJExpandKokkos,FULL,void>(PairLJExpandKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJExpandKokkos,HALF,void>(PairLJExpandKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJExpandKokkos,HALFTHREAD,void>(PairLJExpandKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJExpandKokkos,N2,void>(PairLJExpandKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute<PairLJExpandKokkos,void>(PairLJExpandKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend void pair_virial_fdotr_compute<PairLJExpandKokkos>(PairLJExpandKokkos*);
|
||||
};
|
||||
|
|
|
@ -279,9 +279,6 @@ void PairLJSDKKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/sdk/kk");
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace LAMMPS_NS {
|
|||
template<class DeviceType>
|
||||
class PairLJSDKKokkos : public PairLJSDK {
|
||||
public:
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
enum {COUL_FLAG=0};
|
||||
typedef DeviceType device_type;
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
|
@ -100,15 +100,12 @@ class PairLJSDKKokkos : public PairLJSDK {
|
|||
friend class PairComputeFunctor<PairLJSDKKokkos,FULL,true>;
|
||||
friend class PairComputeFunctor<PairLJSDKKokkos,HALF,true>;
|
||||
friend class PairComputeFunctor<PairLJSDKKokkos,HALFTHREAD,true>;
|
||||
friend class PairComputeFunctor<PairLJSDKKokkos,N2,true>;
|
||||
friend class PairComputeFunctor<PairLJSDKKokkos,FULL,false>;
|
||||
friend class PairComputeFunctor<PairLJSDKKokkos,HALF,false>;
|
||||
friend class PairComputeFunctor<PairLJSDKKokkos,HALFTHREAD,false>;
|
||||
friend class PairComputeFunctor<PairLJSDKKokkos,N2,false>;
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJSDKKokkos,FULL,void>(PairLJSDKKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJSDKKokkos,HALF,void>(PairLJSDKKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJSDKKokkos,HALFTHREAD,void>(PairLJSDKKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairLJSDKKokkos,N2,void>(PairLJSDKKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute<PairLJSDKKokkos,void>(PairLJSDKKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend void pair_virial_fdotr_compute<PairLJSDKKokkos>(PairLJSDKKokkos*);
|
||||
};
|
||||
|
|
|
@ -258,9 +258,6 @@ void PairMorseKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with morse/kk");
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace LAMMPS_NS {
|
|||
template<class DeviceType>
|
||||
class PairMorseKokkos : public PairMorse {
|
||||
public:
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
enum {COUL_FLAG=0};
|
||||
typedef DeviceType device_type;
|
||||
PairMorseKokkos(class LAMMPS *);
|
||||
|
@ -98,15 +98,12 @@ class PairMorseKokkos : public PairMorse {
|
|||
friend class PairComputeFunctor<PairMorseKokkos,FULL,true>;
|
||||
friend class PairComputeFunctor<PairMorseKokkos,HALF,true>;
|
||||
friend class PairComputeFunctor<PairMorseKokkos,HALFTHREAD,true>;
|
||||
friend class PairComputeFunctor<PairMorseKokkos,N2,true>;
|
||||
friend class PairComputeFunctor<PairMorseKokkos,FULL,false>;
|
||||
friend class PairComputeFunctor<PairMorseKokkos,HALF,false>;
|
||||
friend class PairComputeFunctor<PairMorseKokkos,HALFTHREAD,false>;
|
||||
friend class PairComputeFunctor<PairMorseKokkos,N2,false>;
|
||||
friend EV_FLOAT pair_compute_neighlist<PairMorseKokkos,FULL,void>(PairMorseKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairMorseKokkos,HALF,void>(PairMorseKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairMorseKokkos,HALFTHREAD,void>(PairMorseKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairMorseKokkos,N2,void>(PairMorseKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute<PairMorseKokkos,void>(PairMorseKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend void pair_virial_fdotr_compute<PairMorseKokkos>(PairMorseKokkos*);
|
||||
};
|
||||
|
|
|
@ -152,16 +152,12 @@ void PairReaxCKokkos<DeviceType>::init_style()
|
|||
neighbor->requests[irequest]->
|
||||
kokkos_device = std::is_same<DeviceType,LMPDeviceType>::value;
|
||||
|
||||
if (neighflag == FULL) {
|
||||
neighbor->requests[irequest]->full = 1;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
neighbor->requests[irequest]->ghost = 1;
|
||||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
neighbor->requests[irequest]->ghost = 1;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with reax/c/kk");
|
||||
error->all(FLERR,"Must use half neighbor list with pair style reax/c/kk");
|
||||
}
|
||||
|
||||
allocate();
|
||||
|
@ -665,8 +661,6 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
eflag = eflag_in;
|
||||
vflag = vflag_in;
|
||||
|
||||
if (neighflag == FULL) no_virial_fdotr_compute = 1;
|
||||
|
||||
ev_init(eflag,vflag);
|
||||
|
||||
atomKK->sync(execution_space,datamask_read);
|
||||
|
@ -743,11 +737,6 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, PairReaxComputeTabulatedLJCoulomb<HALFTHREAD,1> >(0,inum),*this,ev);
|
||||
else
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxComputeTabulatedLJCoulomb<HALFTHREAD,0> >(0,inum),*this);
|
||||
} else if (neighflag == FULL) {
|
||||
if (evflag)
|
||||
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, PairReaxComputeTabulatedLJCoulomb<FULL,1> >(0,inum),*this,ev);
|
||||
else
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxComputeTabulatedLJCoulomb<FULL,0> >(0,inum),*this);
|
||||
}
|
||||
} else {
|
||||
if (neighflag == HALF) {
|
||||
|
@ -760,11 +749,6 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, PairReaxComputeLJCoulomb<HALFTHREAD,1> >(0,inum),*this,ev);
|
||||
else
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxComputeLJCoulomb<HALFTHREAD,0> >(0,inum),*this);
|
||||
} else if (neighflag == FULL) {
|
||||
if (evflag)
|
||||
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, PairReaxComputeLJCoulomb<FULL,1> >(0,inum),*this,ev);
|
||||
else
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxComputeLJCoulomb<FULL,0> >(0,inum),*this);
|
||||
}
|
||||
}
|
||||
ev_all += ev;
|
||||
|
@ -809,8 +793,6 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBuildListsHalf<HALF> >(0,ignum),*this);
|
||||
else if (neighflag == HALFTHREAD)
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBuildListsHalf<HALFTHREAD> >(0,ignum),*this);
|
||||
else //(neighflag == FULL)
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBuildListsFull>(0,ignum),*this);
|
||||
|
||||
k_resize_bo.modify<DeviceType>();
|
||||
k_resize_bo.sync<LMPHostType>();
|
||||
|
@ -853,11 +835,7 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
Kokkos::Experimental::contribute(d_total_bo, dup_total_bo); // needed in BondOrder1
|
||||
|
||||
// Bond order
|
||||
if (neighflag == HALF) {
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBondOrder1>(0,ignum),*this);
|
||||
} else if (neighflag == HALFTHREAD) {
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBondOrder1>(0,ignum),*this);
|
||||
}
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBondOrder1>(0,ignum),*this);
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBondOrder2>(0,ignum),*this);
|
||||
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, PairReaxBondOrder3>(0,ignum),*this);
|
||||
|
||||
|
@ -1044,14 +1022,14 @@ void PairReaxCKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
|
|||
// free duplicated memory
|
||||
if (need_dup) {
|
||||
dup_f = decltype(dup_f)();
|
||||
dup_eatom = decltype(dup_eatom)();
|
||||
dup_vatom = decltype(dup_vatom)();
|
||||
dup_dDeltap_self = decltype(dup_dDeltap_self)();
|
||||
dup_total_bo = decltype(dup_total_bo)();
|
||||
dup_CdDelta = decltype(dup_CdDelta)();
|
||||
//dup_Cdbo = decltype(dup_Cdbo)();
|
||||
//dup_Cdbopi = decltype(dup_Cdbopi)();
|
||||
//dup_Cdbopi2 = decltype(dup_Cdbopi2)();
|
||||
dup_eatom = decltype(dup_eatom)();
|
||||
dup_vatom = decltype(dup_vatom)();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1119,18 +1097,16 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeLJCoulomb<NEIGHFLAG,
|
|||
const tagint jtag = tag(j);
|
||||
const F_FLOAT qj = q(j);
|
||||
|
||||
if (NEIGHFLAG != FULL) {
|
||||
// skip half of the interactions
|
||||
if (j >= nlocal) {
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
} else if (itag < jtag) {
|
||||
if ((itag+jtag) % 2 == 1) continue;
|
||||
} else {
|
||||
if (x(j,2) < ztmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) < ytmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue;
|
||||
}
|
||||
// skip half of the interactions
|
||||
if (j >= nlocal) {
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
} else if (itag < jtag) {
|
||||
if ((itag+jtag) % 2 == 1) continue;
|
||||
} else {
|
||||
if (x(j,2) < ztmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) < ytmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1215,19 +1191,12 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeLJCoulomb<NEIGHFLAG,
|
|||
fxtmp += delx*ftotal;
|
||||
fytmp += dely*ftotal;
|
||||
fztmp += delz*ftotal;
|
||||
if (NEIGHFLAG != FULL) {
|
||||
a_f(j,0) -= delx*ftotal;
|
||||
a_f(j,1) -= dely*ftotal;
|
||||
a_f(j,2) -= delz*ftotal;
|
||||
}
|
||||
a_f(j,0) -= delx*ftotal;
|
||||
a_f(j,1) -= dely*ftotal;
|
||||
a_f(j,2) -= delz*ftotal;
|
||||
|
||||
if (NEIGHFLAG == FULL) {
|
||||
if (eflag) ev.evdwl += 0.5*evdwl;
|
||||
if (eflag) ev.ecoul += 0.5*ecoul;
|
||||
} else {
|
||||
if (eflag) ev.evdwl += evdwl;
|
||||
if (eflag) ev.ecoul += ecoul;
|
||||
}
|
||||
if (eflag) ev.evdwl += evdwl;
|
||||
if (eflag) ev.ecoul += ecoul;
|
||||
|
||||
if (vflag_either || eflag_atom) this->template ev_tally<NEIGHFLAG>(ev,i,j,evdwl+ecoul,-ftotal,delx,dely,delz);
|
||||
}
|
||||
|
@ -1276,18 +1245,16 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeTabulatedLJCoulomb<N
|
|||
const tagint jtag = tag(j);
|
||||
const F_FLOAT qj = q(j);
|
||||
|
||||
if (NEIGHFLAG != FULL) {
|
||||
// skip half of the interactions
|
||||
if (j >= nlocal) {
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
} else if (itag < jtag) {
|
||||
if ((itag+jtag) % 2 == 1) continue;
|
||||
} else {
|
||||
if (x(j,2) < ztmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) < ytmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue;
|
||||
}
|
||||
// skip half of the interactions
|
||||
if (j >= nlocal) {
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
} else if (itag < jtag) {
|
||||
if ((itag+jtag) % 2 == 1) continue;
|
||||
} else {
|
||||
if (x(j,2) < ztmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) < ytmp) continue;
|
||||
if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1331,19 +1298,12 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeTabulatedLJCoulomb<N
|
|||
fxtmp += delx*ftotal;
|
||||
fytmp += dely*ftotal;
|
||||
fztmp += delz*ftotal;
|
||||
if (NEIGHFLAG != FULL) {
|
||||
a_f(j,0) -= delx*ftotal;
|
||||
a_f(j,1) -= dely*ftotal;
|
||||
a_f(j,2) -= delz*ftotal;
|
||||
}
|
||||
a_f(j,0) -= delx*ftotal;
|
||||
a_f(j,1) -= dely*ftotal;
|
||||
a_f(j,2) -= delz*ftotal;
|
||||
|
||||
if (NEIGHFLAG == FULL) {
|
||||
if (eflag) ev.evdwl += 0.5*evdwl;
|
||||
if (eflag) ev.ecoul += 0.5*ecoul;
|
||||
} else {
|
||||
if (eflag) ev.evdwl += evdwl;
|
||||
if (eflag) ev.ecoul += ecoul;
|
||||
}
|
||||
if (eflag) ev.evdwl += evdwl;
|
||||
if (eflag) ev.ecoul += ecoul;
|
||||
|
||||
if (vflag_either || eflag_atom) this->template ev_tally<NEIGHFLAG>(ev,i,j,evdwl+ecoul,-ftotal,delx,dely,delz);
|
||||
}
|
||||
|
@ -1436,10 +1396,8 @@ KOKKOS_INLINE_FUNCTION
|
|||
void PairReaxCKokkos<DeviceType>::operator()(PairReaxZero, const int &n) const {
|
||||
d_total_bo(n) = 0.0;
|
||||
d_CdDelta(n) = 0.0;
|
||||
if (neighflag != FULL) {
|
||||
d_bo_num(n) = 0.0;
|
||||
d_hb_num(n) = 0.0;
|
||||
}
|
||||
d_bo_num(n) = 0.0;
|
||||
d_hb_num(n) = 0.0;
|
||||
for (int j = 0; j < 3; j++)
|
||||
d_dDeltap_self(n,j) = 0.0;
|
||||
}
|
||||
|
@ -1850,261 +1808,6 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxBondOrder1, const int &ii)
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
template<int NEIGHFLAG>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairReaxCKokkos<DeviceType>::operator()(PairReaxBuildListsHalf_LessAtomics<NEIGHFLAG>, const int &ii) const {
|
||||
|
||||
if (d_resize_bo() || d_resize_hb())
|
||||
return;
|
||||
|
||||
const int i = d_ilist[ii];
|
||||
const X_FLOAT xtmp = x(i,0);
|
||||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const tagint itag = tag(i);
|
||||
const int jnum = d_numneigh[i];
|
||||
|
||||
F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[3];
|
||||
|
||||
int j_index,i_index;
|
||||
d_bo_first[i] = i*maxbo;
|
||||
const int bo_first_i = d_bo_first[i];
|
||||
|
||||
int ihb = -1;
|
||||
int jhb = -1;
|
||||
|
||||
int hb_first_i;
|
||||
if (cut_hbsq > 0.0) {
|
||||
ihb = paramssing(itype).p_hbond;
|
||||
if (ihb == 1) {
|
||||
d_hb_first[i] = i*maxhb;
|
||||
hb_first_i = d_hb_first[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (int jj = 0; jj < jnum; jj++) {
|
||||
int j = d_neighbors(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
d_bo_first[j] = j*maxbo;
|
||||
d_hb_first[j] = j*maxhb;
|
||||
const int jtype = type(j);
|
||||
|
||||
delij[0] = x(j,0) - xtmp;
|
||||
delij[1] = x(j,1) - ytmp;
|
||||
delij[2] = x(j,2) - ztmp;
|
||||
const F_FLOAT rsq = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2];
|
||||
|
||||
double cutoffsq;
|
||||
if(i < nlocal) cutoffsq = MAX(cut_bosq,cut_hbsq);
|
||||
else cutoffsq = cut_bosq;
|
||||
if (rsq > cutoffsq) continue;
|
||||
|
||||
// hbond list
|
||||
if (i < nlocal && cut_hbsq > 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) {
|
||||
jhb = paramssing(jtype).p_hbond;
|
||||
if (ihb == 1 && jhb == 2) {
|
||||
if (NEIGHFLAG == HALF) {
|
||||
j_index = hb_first_i + d_hb_num[i];
|
||||
d_hb_num[i]++;
|
||||
} else {
|
||||
j_index = hb_first_i + Kokkos::atomic_fetch_add(&d_hb_num[i],1);
|
||||
}
|
||||
|
||||
const int jj_index = j_index - hb_first_i;
|
||||
|
||||
if (jj_index >= maxhb) {
|
||||
d_resize_hb() = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
d_hb_list[j_index] = j;
|
||||
} else if ( j < nlocal && ihb == 2 && jhb == 1) {
|
||||
if (NEIGHFLAG == HALF) {
|
||||
i_index = d_hb_first[j] + d_hb_num[j];
|
||||
d_hb_num[j]++;
|
||||
} else {
|
||||
i_index = d_hb_first[j] + Kokkos::atomic_fetch_add(&d_hb_num[j],1);
|
||||
}
|
||||
|
||||
const int ii_index = i_index - d_hb_first[j];
|
||||
|
||||
if (ii_index >= maxhb) {
|
||||
d_resize_hb() = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
d_hb_list[i_index] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (rsq > cut_bosq) continue;
|
||||
|
||||
// bond_list
|
||||
const F_FLOAT rij = sqrt(rsq);
|
||||
const F_FLOAT p_bo1 = paramstwbp(itype,jtype).p_bo1;
|
||||
const F_FLOAT p_bo2 = paramstwbp(itype,jtype).p_bo2;
|
||||
const F_FLOAT p_bo3 = paramstwbp(itype,jtype).p_bo3;
|
||||
const F_FLOAT p_bo4 = paramstwbp(itype,jtype).p_bo4;
|
||||
const F_FLOAT p_bo5 = paramstwbp(itype,jtype).p_bo5;
|
||||
const F_FLOAT p_bo6 = paramstwbp(itype,jtype).p_bo6;
|
||||
const F_FLOAT r_s = paramstwbp(itype,jtype).r_s;
|
||||
const F_FLOAT r_pi = paramstwbp(itype,jtype).r_pi;
|
||||
const F_FLOAT r_pi2 = paramstwbp(itype,jtype).r_pi2;
|
||||
|
||||
if (paramssing(itype).r_s > 0.0 && paramssing(jtype).r_s > 0.0) {
|
||||
C12 = p_bo1*pow(rij/r_s,p_bo2);
|
||||
BO_s = (1.0+bo_cut)*exp(C12);
|
||||
}
|
||||
else BO_s = C12 = 0.0;
|
||||
|
||||
if (paramssing(itype).r_pi > 0.0 && paramssing(jtype).r_pi > 0.0) {
|
||||
C34 = p_bo3*pow(rij/r_pi,p_bo4);
|
||||
BO_pi = exp(C34);
|
||||
}
|
||||
else BO_pi = C34 = 0.0;
|
||||
|
||||
if (paramssing(itype).r_pi2 > 0.0 && paramssing(jtype).r_pi2 > 0.0) {
|
||||
C56 = p_bo5*pow(rij/r_pi2,p_bo6);
|
||||
BO_pi2 = exp(C56);
|
||||
}
|
||||
else BO_pi2 = C56 = 0.0;
|
||||
|
||||
BO = BO_s + BO_pi + BO_pi2;
|
||||
if (BO < bo_cut) continue;
|
||||
|
||||
if (NEIGHFLAG == HALF) {
|
||||
j_index = bo_first_i + d_bo_num[i];
|
||||
i_index = d_bo_first[j] + d_bo_num[j];
|
||||
d_bo_num[i]++;
|
||||
d_bo_num[j]++;
|
||||
} else {
|
||||
j_index = bo_first_i + Kokkos::atomic_fetch_add(&d_bo_num[i],1);
|
||||
i_index = d_bo_first[j] + Kokkos::atomic_fetch_add(&d_bo_num[j],1);
|
||||
}
|
||||
|
||||
const int jj_index = j_index - bo_first_i;
|
||||
const int ii_index = i_index - d_bo_first[j];
|
||||
|
||||
if (jj_index >= maxbo || ii_index >= maxbo) {
|
||||
d_resize_bo() = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
d_bo_list[j_index] = j;
|
||||
d_bo_list[i_index] = i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairReaxCKokkos<DeviceType>::operator()(PairReaxBondOrder1_LessAtomics, const int &ii) const {
|
||||
|
||||
F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[3], dBOp_i[3], dln_BOp_pi_i[3], dln_BOp_pi2_i[3];
|
||||
|
||||
const int i = d_ilist[ii];
|
||||
const X_FLOAT xtmp = x(i,0);
|
||||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
|
||||
const int j_start = d_bo_first[i];
|
||||
const int j_end = j_start + d_bo_num[i];
|
||||
|
||||
F_FLOAT total_bo = 0.0;
|
||||
|
||||
for (int jj = j_start; jj < j_end; jj++) {
|
||||
int j = d_bo_list[jj];
|
||||
j &= NEIGHMASK;
|
||||
delij[0] = x(j,0) - xtmp;
|
||||
delij[1] = x(j,1) - ytmp;
|
||||
delij[2] = x(j,2) - ztmp;
|
||||
const F_FLOAT rsq = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2];
|
||||
const F_FLOAT rij = sqrt(rsq);
|
||||
const int jtype = type(j);
|
||||
const int j_index = jj - j_start;
|
||||
|
||||
// calculate uncorrected BO and total bond order
|
||||
|
||||
const F_FLOAT p_bo1 = paramstwbp(itype,jtype).p_bo1;
|
||||
const F_FLOAT p_bo2 = paramstwbp(itype,jtype).p_bo2;
|
||||
const F_FLOAT p_bo3 = paramstwbp(itype,jtype).p_bo3;
|
||||
const F_FLOAT p_bo4 = paramstwbp(itype,jtype).p_bo4;
|
||||
const F_FLOAT p_bo5 = paramstwbp(itype,jtype).p_bo5;
|
||||
const F_FLOAT p_bo6 = paramstwbp(itype,jtype).p_bo6;
|
||||
const F_FLOAT r_s = paramstwbp(itype,jtype).r_s;
|
||||
const F_FLOAT r_pi = paramstwbp(itype,jtype).r_pi;
|
||||
const F_FLOAT r_pi2 = paramstwbp(itype,jtype).r_pi2;
|
||||
|
||||
if (paramssing(itype).r_s > 0.0 && paramssing(jtype).r_s > 0.0) {
|
||||
C12 = p_bo1*pow(rij/r_s,p_bo2);
|
||||
BO_s = (1.0+bo_cut)*exp(C12);
|
||||
}
|
||||
else BO_s = C12 = 0.0;
|
||||
|
||||
if (paramssing(itype).r_pi > 0.0 && paramssing(jtype).r_pi > 0.0) {
|
||||
C34 = p_bo3*pow(rij/r_pi,p_bo4);
|
||||
BO_pi = exp(C34);
|
||||
}
|
||||
else BO_pi = C34 = 0.0;
|
||||
|
||||
if (paramssing(itype).r_pi2 > 0.0 && paramssing(jtype).r_pi2 > 0.0) {
|
||||
C56 = p_bo5*pow(rij/r_pi2,p_bo6);
|
||||
BO_pi2 = exp(C56);
|
||||
}
|
||||
else BO_pi2 = C56 = 0.0;
|
||||
|
||||
BO = BO_s + BO_pi + BO_pi2;
|
||||
if (BO < bo_cut) continue;
|
||||
|
||||
d_BO(i,j_index) = BO;
|
||||
d_BO_s(i,j_index) = BO;
|
||||
d_BO_pi(i,j_index) = BO_pi;
|
||||
d_BO_pi2(i,j_index) = BO_pi2;
|
||||
|
||||
F_FLOAT Cln_BOp_s = p_bo2 * C12 / rij / rij;
|
||||
F_FLOAT Cln_BOp_pi = p_bo4 * C34 / rij / rij;
|
||||
F_FLOAT Cln_BOp_pi2 = p_bo6 * C56 / rij / rij;
|
||||
|
||||
if (nlocal == 0)
|
||||
Cln_BOp_s = Cln_BOp_pi = Cln_BOp_pi2 = 0.0;
|
||||
|
||||
for (int d = 0; d < 3; d++) dln_BOp_pi_i[d] = -(BO_pi*Cln_BOp_pi)*delij[d];
|
||||
for (int d = 0; d < 3; d++) dln_BOp_pi2_i[d] = -(BO_pi2*Cln_BOp_pi2)*delij[d];
|
||||
for (int d = 0; d < 3; d++) dBOp_i[d] = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2)*delij[d];
|
||||
for (int d = 0; d < 3; d++) d_dDeltap_self(i,d) += dBOp_i[d];
|
||||
|
||||
d_dln_BOp_pix(i,j_index) = dln_BOp_pi_i[0];
|
||||
d_dln_BOp_piy(i,j_index) = dln_BOp_pi_i[1];
|
||||
d_dln_BOp_piz(i,j_index) = dln_BOp_pi_i[2];
|
||||
|
||||
d_dln_BOp_pi2x(i,j_index) = dln_BOp_pi2_i[0];
|
||||
d_dln_BOp_pi2y(i,j_index) = dln_BOp_pi2_i[1];
|
||||
d_dln_BOp_pi2z(i,j_index) = dln_BOp_pi2_i[2];
|
||||
|
||||
d_dBOpx(i,j_index) = dBOp_i[0];
|
||||
d_dBOpy(i,j_index) = dBOp_i[1];
|
||||
d_dBOpz(i,j_index) = dBOp_i[2];
|
||||
|
||||
d_BO(i,j_index) -= bo_cut;
|
||||
d_BO_s(i,j_index) -= bo_cut;
|
||||
total_bo += d_BO(i,j_index);
|
||||
}
|
||||
d_total_bo[i] += total_bo;
|
||||
|
||||
const F_FLOAT val_i = paramssing(itype).valency;
|
||||
d_Deltap[i] = d_total_bo[i] - val_i;
|
||||
d_Deltap_boc[i] = d_total_bo[i] - paramssing(itype).valency_val;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairReaxCKokkos<DeviceType>::operator()(PairReaxBondOrder2, const int &ii) const {
|
||||
|
@ -3728,7 +3431,7 @@ void PairReaxCKokkos<DeviceType>::ev_tally(EV_FLOAT_REAX &ev, const int &i, cons
|
|||
if (eflag_atom) {
|
||||
const E_FLOAT epairhalf = 0.5 * epair;
|
||||
a_eatom[i] += epairhalf;
|
||||
if (NEIGHFLAG != FULL) a_eatom[j] += epairhalf;
|
||||
a_eatom[j] += epairhalf;
|
||||
}
|
||||
|
||||
if (VFLAG) {
|
||||
|
@ -3740,21 +3443,12 @@ void PairReaxCKokkos<DeviceType>::ev_tally(EV_FLOAT_REAX &ev, const int &i, cons
|
|||
const E_FLOAT v5 = dely*delz*fpair;
|
||||
|
||||
if (vflag_global) {
|
||||
if (NEIGHFLAG != FULL) {
|
||||
ev.v[0] += v0;
|
||||
ev.v[1] += v1;
|
||||
ev.v[2] += v2;
|
||||
ev.v[3] += v3;
|
||||
ev.v[4] += v4;
|
||||
ev.v[5] += v5;
|
||||
} else {
|
||||
ev.v[0] += 0.5*v0;
|
||||
ev.v[1] += 0.5*v1;
|
||||
ev.v[2] += 0.5*v2;
|
||||
ev.v[3] += 0.5*v3;
|
||||
ev.v[4] += 0.5*v4;
|
||||
ev.v[5] += 0.5*v5;
|
||||
}
|
||||
ev.v[0] += v0;
|
||||
ev.v[1] += v1;
|
||||
ev.v[2] += v2;
|
||||
ev.v[3] += v3;
|
||||
ev.v[4] += v4;
|
||||
ev.v[5] += v5;
|
||||
}
|
||||
|
||||
if (vflag_atom) {
|
||||
|
@ -3764,15 +3458,12 @@ void PairReaxCKokkos<DeviceType>::ev_tally(EV_FLOAT_REAX &ev, const int &i, cons
|
|||
a_vatom(i,3) += 0.5*v3;
|
||||
a_vatom(i,4) += 0.5*v4;
|
||||
a_vatom(i,5) += 0.5*v5;
|
||||
|
||||
if (NEIGHFLAG != FULL) {
|
||||
a_vatom(j,0) += 0.5*v0;
|
||||
a_vatom(j,1) += 0.5*v1;
|
||||
a_vatom(j,2) += 0.5*v2;
|
||||
a_vatom(j,3) += 0.5*v3;
|
||||
a_vatom(j,4) += 0.5*v4;
|
||||
a_vatom(j,5) += 0.5*v5;
|
||||
}
|
||||
a_vatom(j,0) += 0.5*v0;
|
||||
a_vatom(j,1) += 0.5*v1;
|
||||
a_vatom(j,2) += 0.5*v2;
|
||||
a_vatom(j,3) += 0.5*v3;
|
||||
a_vatom(j,4) += 0.5*v4;
|
||||
a_vatom(j,5) += 0.5*v5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,9 +64,6 @@ struct PairReaxBuildListsFull{};
|
|||
template<int NEIGHFLAG>
|
||||
struct PairReaxBuildListsHalf{};
|
||||
|
||||
template<int NEIGHFLAG>
|
||||
struct PairReaxBuildListsHalf_LessAtomics{};
|
||||
|
||||
struct PairReaxZero{};
|
||||
|
||||
struct PairReaxZeroEAtom{};
|
||||
|
@ -75,8 +72,6 @@ struct PairReaxZeroVAtom{};
|
|||
|
||||
struct PairReaxBondOrder1{};
|
||||
|
||||
struct PairReaxBondOrder1_LessAtomics{};
|
||||
|
||||
struct PairReaxBondOrder2{};
|
||||
|
||||
struct PairReaxBondOrder3{};
|
||||
|
@ -164,10 +159,6 @@ class PairReaxCKokkos : public PairReaxC {
|
|||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(PairReaxBuildListsHalf<NEIGHFLAG>, const int&) const;
|
||||
|
||||
template<int NEIGHFLAG>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(PairReaxBuildListsHalf_LessAtomics<NEIGHFLAG>, const int&) const;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(PairReaxZero, const int&) const;
|
||||
|
||||
|
@ -180,9 +171,6 @@ class PairReaxCKokkos : public PairReaxC {
|
|||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(PairReaxBondOrder1, const int&) const;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(PairReaxBondOrder1_LessAtomics, const int&) const;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator()(PairReaxBondOrder2, const int&) const;
|
||||
|
||||
|
@ -437,7 +425,7 @@ class PairReaxCKokkos : public PairReaxC {
|
|||
typename AT::t_ffloat_2d_dl d_sum_ovun;
|
||||
typename AT::t_ffloat_2d_dl d_dBOpx, d_dBOpy, d_dBOpz;
|
||||
|
||||
int neighflag,newton_pair, maxnumneigh, maxhb, maxbo;
|
||||
int neighflag, newton_pair, maxnumneigh, maxhb, maxbo;
|
||||
int nlocal,nall,eflag,vflag;
|
||||
F_FLOAT cut_nbsq, cut_hbsq, cut_bosq, bo_cut, thb_cut, thb_cutsq;
|
||||
F_FLOAT bo_cut_bond;
|
||||
|
|
|
@ -136,12 +136,6 @@ void PairTableKokkos<DeviceType>::compute_style(int eflag_in, int vflag_in)
|
|||
if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev);
|
||||
else Kokkos::parallel_for(list->inum,f);
|
||||
f.contribute();
|
||||
} else if (neighflag == N2) {
|
||||
PairComputeFunctor<PairTableKokkos<DeviceType>,N2,false,S_TableCompute<DeviceType,TABSTYLE> >
|
||||
f(this,(NeighListKokkos<DeviceType>*) list);
|
||||
if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev);
|
||||
else Kokkos::parallel_for(list->inum,f);
|
||||
f.contribute();
|
||||
}
|
||||
} else {
|
||||
if (neighflag == FULL) {
|
||||
|
@ -162,12 +156,6 @@ void PairTableKokkos<DeviceType>::compute_style(int eflag_in, int vflag_in)
|
|||
if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev);
|
||||
else Kokkos::parallel_for(list->inum,f);
|
||||
f.contribute();
|
||||
} else if (neighflag == N2) {
|
||||
PairComputeFunctor<PairTableKokkos<DeviceType>,N2,true,S_TableCompute<DeviceType,TABSTYLE> >
|
||||
f(this,(NeighListKokkos<DeviceType>*) list);
|
||||
if (eflag || vflag) Kokkos::parallel_reduce(list->inum,f,ev);
|
||||
else Kokkos::parallel_for(list->inum,f);
|
||||
f.contribute();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -525,9 +513,6 @@ void PairTableKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk");
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ template<class DeviceType>
|
|||
class PairTableKokkos : public PairTable {
|
||||
public:
|
||||
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
enum {COUL_FLAG=0};
|
||||
typedef DeviceType device_type;
|
||||
typedef ArrayTypes<DeviceType> AT;
|
||||
|
@ -139,38 +139,30 @@ class PairTableKokkos : public PairTable {
|
|||
friend class PairComputeFunctor<PairTableKokkos,FULL,true,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,true,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,true,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,true,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,FULL,false,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,false,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,false,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,false,S_TableCompute<DeviceType,LOOKUP> >;
|
||||
|
||||
friend class PairComputeFunctor<PairTableKokkos,FULL,true,S_TableCompute<DeviceType,LINEAR> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,true,S_TableCompute<DeviceType,LINEAR> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,true,S_TableCompute<DeviceType,LINEAR> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,true,S_TableCompute<DeviceType,LINEAR> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,FULL,false,S_TableCompute<DeviceType,LINEAR> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,false,S_TableCompute<DeviceType,LINEAR> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,false,S_TableCompute<DeviceType,LINEAR> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,false,S_TableCompute<DeviceType,LINEAR> >;
|
||||
|
||||
friend class PairComputeFunctor<PairTableKokkos,FULL,true,S_TableCompute<DeviceType,SPLINE> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,true,S_TableCompute<DeviceType,SPLINE> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,true,S_TableCompute<DeviceType,SPLINE> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,true,S_TableCompute<DeviceType,SPLINE> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,FULL,false,S_TableCompute<DeviceType,SPLINE> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,false,S_TableCompute<DeviceType,SPLINE> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,false,S_TableCompute<DeviceType,SPLINE> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,false,S_TableCompute<DeviceType,SPLINE> >;
|
||||
|
||||
friend class PairComputeFunctor<PairTableKokkos,FULL,true,S_TableCompute<DeviceType,BITMAP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,true,S_TableCompute<DeviceType,BITMAP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,true,S_TableCompute<DeviceType,BITMAP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,true,S_TableCompute<DeviceType,BITMAP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,FULL,false,S_TableCompute<DeviceType,BITMAP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALF,false,S_TableCompute<DeviceType,BITMAP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,HALFTHREAD,false,S_TableCompute<DeviceType,BITMAP> >;
|
||||
friend class PairComputeFunctor<PairTableKokkos,N2,false,S_TableCompute<DeviceType,BITMAP> >;
|
||||
|
||||
friend void pair_virial_fdotr_compute<PairTableKokkos>(PairTableKokkos*);
|
||||
};
|
||||
|
|
|
@ -665,8 +665,6 @@ void PairTableRXKokkos<DeviceType>::compute_style(int eflag_in, int vflag_in)
|
|||
nspecies, isite1, isite2, fractionalWeighting,
|
||||
mixWtSite1old, mixWtSite2old, mixWtSite1, mixWtSite2);
|
||||
|
||||
if (neighflag == N2) error->all(FLERR,"pair table/rx/kk can't handle N2 yet\n");
|
||||
|
||||
NeighListKokkos<DeviceType>* l =
|
||||
dynamic_cast<NeighListKokkos<DeviceType>*>(list);
|
||||
|
||||
|
@ -1282,9 +1280,6 @@ void PairTableRXKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk");
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace LAMMPS_NS {
|
|||
template<class DeviceType>
|
||||
class PairTableRXKokkos : public PairTable {
|
||||
public:
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2};
|
||||
enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
|
||||
typedef DeviceType device_type;
|
||||
|
||||
PairTableRXKokkos(class LAMMPS *);
|
||||
|
|
|
@ -103,19 +103,15 @@ class PairYukawaKokkos : public PairYukawa {
|
|||
friend class PairComputeFunctor<PairYukawaKokkos,FULL,true>;
|
||||
friend class PairComputeFunctor<PairYukawaKokkos,HALF,true>;
|
||||
friend class PairComputeFunctor<PairYukawaKokkos,HALFTHREAD,true>;
|
||||
friend class PairComputeFunctor<PairYukawaKokkos,N2,true>;
|
||||
friend class PairComputeFunctor<PairYukawaKokkos,FULL,false>;
|
||||
friend class PairComputeFunctor<PairYukawaKokkos,HALF,false>;
|
||||
friend class PairComputeFunctor<PairYukawaKokkos,HALFTHREAD,false>;
|
||||
friend class PairComputeFunctor<PairYukawaKokkos,N2,false>;
|
||||
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,FULL,void>(
|
||||
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALF,void>(
|
||||
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,HALFTHREAD,void>(
|
||||
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute_neighlist<PairYukawaKokkos,N2,void>(
|
||||
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend EV_FLOAT pair_compute<PairYukawaKokkos,void>(
|
||||
PairYukawaKokkos*,NeighListKokkos<DeviceType>*);
|
||||
friend void pair_virial_fdotr_compute<PairYukawaKokkos>(PairYukawaKokkos*);
|
||||
|
|
|
@ -103,9 +103,6 @@ void PairZBLKokkos<DeviceType>::init_style()
|
|||
} else if (neighflag == HALF || neighflag == HALFTHREAD) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 1;
|
||||
} else if (neighflag == N2) {
|
||||
neighbor->requests[irequest]->full = 0;
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
} else {
|
||||
error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk");
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp) : PPPM(lmp)
|
|||
// see JCP 109, pg 7698 for derivation of coefficients
|
||||
// higher order coefficients may be computed if needed
|
||||
|
||||
acons = typename Kokkos::DualView<F_FLOAT[8][7],Kokkos::LayoutRight,LMPDeviceType>::t_host("pppm:acons");
|
||||
acons = typename Kokkos::DualView<F_FLOAT[8][7],Kokkos::LayoutRight,DeviceType>::t_host("pppm:acons");
|
||||
acons(1,0) = 2.0 / 3.0;
|
||||
acons(2,0) = 1.0 / 50.0;
|
||||
acons(2,1) = 5.0 / 294.0;
|
||||
|
@ -2581,7 +2581,7 @@ void PPPMKokkos<DeviceType>::operator()(TagPPPM_fieldforce_peratom, const int &i
|
|||
------------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
void PPPMKokkos<DeviceType>::pack_forward_kspace_kokkos(int flag, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
void PPPMKokkos<DeviceType>::pack_forward_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
{
|
||||
typename AT::t_int_2d_um d_list = k_list.view<DeviceType>();
|
||||
d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL());
|
||||
|
@ -2637,7 +2637,7 @@ void PPPMKokkos<DeviceType>::operator()(TagPPPM_pack_forward2, const int &i) con
|
|||
------------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
void PPPMKokkos<DeviceType>::unpack_forward_kspace_kokkos(int flag, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
void PPPMKokkos<DeviceType>::unpack_forward_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
{
|
||||
typename AT::t_int_2d_um d_list = k_list.view<DeviceType>();
|
||||
d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL());
|
||||
|
@ -2694,7 +2694,7 @@ void PPPMKokkos<DeviceType>::operator()(TagPPPM_unpack_forward2, const int &i) c
|
|||
------------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
void PPPMKokkos<DeviceType>::pack_reverse_kspace_kokkos(int flag, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
void PPPMKokkos<DeviceType>::pack_reverse_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
{
|
||||
typename AT::t_int_2d_um d_list = k_list.view<DeviceType>();
|
||||
d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL());
|
||||
|
@ -2724,7 +2724,7 @@ void PPPMKokkos<DeviceType>::operator()(TagPPPM_pack_reverse, const int &i) cons
|
|||
------------------------------------------------------------------------- */
|
||||
|
||||
template<class DeviceType>
|
||||
void PPPMKokkos<DeviceType>::unpack_reverse_kspace_kokkos(int flag, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
void PPPMKokkos<DeviceType>::unpack_reverse_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index)
|
||||
{
|
||||
typename AT::t_int_2d_um d_list = k_list.view<DeviceType>();
|
||||
d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL());
|
||||
|
|
|
@ -403,10 +403,10 @@ class PPPMKokkos : public PPPM, public KokkosBaseFFT {
|
|||
|
||||
// grid communication
|
||||
|
||||
void pack_forward_kspace_kokkos(int, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &, int, DAT::tdual_int_2d &, int);
|
||||
void unpack_forward_kspace_kokkos(int, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &, int, DAT::tdual_int_2d &, int);
|
||||
void pack_reverse_kspace_kokkos(int, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &, int, DAT::tdual_int_2d &, int);
|
||||
void unpack_reverse_kspace_kokkos(int, Kokkos::DualView<FFT_SCALAR*,Kokkos::LayoutRight,LMPDeviceType> &, int, DAT::tdual_int_2d &, int);
|
||||
void pack_forward_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int);
|
||||
void unpack_forward_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int);
|
||||
void pack_reverse_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int);
|
||||
void unpack_reverse_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int);
|
||||
|
||||
// triclinic
|
||||
|
||||
|
|
Loading…
Reference in New Issue